Last active
December 7, 2023 01:30
-
-
Save dnery/20867de1408110987c29c94817a4503f to your computer and use it in GitHub Desktop.
My git config file with cute handy aliases
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[user] | |
email = EDIT | |
name = EDIT | |
[core] | |
editor = vim | |
[push] | |
default = simple | |
[alias] | |
co = checkout | |
st = status | |
br = branch | |
ci = commit | |
pl = pull | |
ps = push | |
lo = log --oneline | |
ru = remote update | |
brv = branch -v -v | |
rom = rebase origin/master | |
rod = rebase origin/develop | |
psf = push --force-with-lease | |
rub = !git remote update && git branch -v -v | |
cap = !git commit -a --amend && git push --force-with-lease | |
compare = "!f() { \ | |
git branch | tr -d ' '| tr -d '*' | while read -r branch_name; do\ | |
if [ \"$branch_name\" != 'develop' ]; then\ | |
echo \"---> $branch_name\";\ | |
git diff --stat \"origin/develop...${branch_name}\";\ | |
fi;\ | |
done;\ | |
};\ | |
f" | |
wayback = "!f() { git diff --name-status HEAD~\"$1\" HEAD; }; f" | |
# stash manipulation | |
sp = stash push | |
sa = stash apply | |
# log and branch visualization helpers | |
head = !git log --oneline | head | |
tail = !git br | tail | |
# Move untracked files to '.stash' directory in user home | |
lclean = "!f() { \ | |
[ -d ~/.stash ] || mkdir ~/.stash; \ | |
git ls-files --others --exclude-standard | while read -r filename; do \ | |
mv \"$filename\" ~/.stash; \ | |
done; \ | |
}; \ | |
f" | |
# Move untracked files from '.stash' back into wd | |
lrepop = "!f() { \ | |
[ -d ~/.stash ] || mkdir ~/.stash; \ | |
for filename in ~/.stash/*; do \ | |
mv \"$filename\" .; \ | |
done; \ | |
}; \ | |
f" | |
[diff] | |
tool = p4merge | |
[difftool "p4merge"] | |
cmd = "p4merge $LOCAL $REMOTE" | |
[merge] | |
tool = p4merge | |
# Download: https://www.perforce.com/downloads/visual-merge-tool | |
# Install pt1: extract tarball, move bins to /usr/local/bin and libs to /usr/local/lib | |
# Install pt2: on Ubuntu, install qt5-default package if you get "...application failed to start..." | |
[mergetool "p4merge"] | |
cmd = "p4merge $BASE $LOCAL $REMOTE $MERGED" | |
trustExitCode = false | |
keepTemporaries = false | |
keepBackup = false | |
prompt = false | |
[filter "lfs"] | |
process = git-lfs filter-process | |
required = true | |
clean = git-lfs clean -- %f | |
smudge = git-lfs smudge -- %f |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment