mirror of
https://codeberg.org/vlw/dotfiles.git
synced 2025-09-14 03:03:42 +02:00
wip: 2025-06-06T08:27:12+0200 (1749191232)
This commit is contained in:
parent
24b007ed66
commit
9a91c12b6d
1 changed files with 33 additions and 12 deletions
|
@ -45,6 +45,38 @@ cdll () {
|
||||||
cp -P -- "$1" && ll
|
cp -P -- "$1" && ll
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Short-hands for various git functions
|
||||||
|
gitf () {
|
||||||
|
case "$1" in
|
||||||
|
# Stage all changes and fall through to WIP commit
|
||||||
|
"aw")
|
||||||
|
git add .
|
||||||
|
gitf w
|
||||||
|
;;
|
||||||
|
|
||||||
|
# Create a git "Work in Progress" commit with timestamps
|
||||||
|
"w")
|
||||||
|
git commit -m "wip: $(date +%Y-%m-%dT%H:%M:%S%z) ($(date +%s))"
|
||||||
|
;;
|
||||||
|
|
||||||
|
# Clear local branches that have no upstream on remote (cleanup)
|
||||||
|
"c")
|
||||||
|
git fetch -p && git branch -vv | awk '/: gone]/{print $1}' | xargs git branch -D
|
||||||
|
;;
|
||||||
|
|
||||||
|
# Pull current branch from a remote (defaults to "origin")
|
||||||
|
"p")
|
||||||
|
local remote="${2:-origin}"
|
||||||
|
|
||||||
|
git pull "$remote" $(git rev-parse --abbrev-ref HEAD)
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
git status
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
# SSH to machine in debug mode at local.vlw.se
|
# SSH to machine in debug mode at local.vlw.se
|
||||||
sshl () {
|
sshl () {
|
||||||
# Set login name from first argument or default to current user
|
# Set login name from first argument or default to current user
|
||||||
|
@ -53,17 +85,6 @@ sshl () {
|
||||||
ssh -p 2222 "$user"@local.vlw.se
|
ssh -p 2222 "$user"@local.vlw.se
|
||||||
}
|
}
|
||||||
|
|
||||||
# Create standard git WIP commit with timestamps
|
|
||||||
alias gitw="git commit -m \"wip: $(date +%Y-%m-%dT%H:%M:%S%z) ($(date +%s))\""
|
|
||||||
# Create a git WIP tag with the current timestamp. Prompt user for tag comment.
|
|
||||||
alias gitt="git tag -a 'wip-$(date +%s)'"
|
|
||||||
# Remove dropped upstream git branches from remote
|
|
||||||
alias gitc="git fetch -p && git branch -vv | awk '/: gone]/{print $1}' | xargs git branch -D"
|
|
||||||
# Shorthand git pull origin
|
|
||||||
alias gitp="git pull origin"
|
|
||||||
# Shorthand git status"
|
|
||||||
alias gits="git status"
|
|
||||||
|
|
||||||
# Generate random 16byte HEX
|
# Generate random 16byte HEX
|
||||||
alias rng16="head -c 16 /dev/random | xxd -p"
|
alias rng16="head -c 16 /dev/random | xxd -p"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue