-
-
Save ranran2121/faaf74e513043bd3163c01d99505c758 to your computer and use it in GitHub Desktop.
a collection of all the alias I find interesting or useful to remember in git
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
alias = config --get-regexp alias | |
bisectstop = bisect reset | |
branchamendhistory = filter branch | |
branchcommitid = "!f() { git branch --contains $id; }; f" | |
branchcreate = checkout -b | |
branchdelete = branch -d | |
branchesshow = branch --all --verbose | |
branchwithfile = "!f() { git log --all --format=%H $name | while read f; do git branch --contains $f; done | sort -u; }; f" | |
c = commit -m | |
ca = commit -au -m | |
cfile = log --all | |
commitfindword = "!f() { git log --grep=\"$1\"; }; f" | |
commitmodifyfile = log --follow -- | |
commitshowfiles = show --name-only | |
checkstage = diff --staged | |
configl = config --list --show-origin | |
erase = reset --hard HEAD | |
fetcho = fetch origin | |
fetchu = fetch upstream | |
findbugstart = bisect | |
gt = checkout | |
lastc = log -1 HEAD | |
lastcadd = commit --amend --no-edit | |
lastcundo = reset HEAD~ | |
lg = log --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cD - %cr) %C(bold blue)<%an>%Creset' | |
m = merge | |
mc = merge --continue | |
ma = merge --abort | |
pl = pull | |
plr = pull --rebase | |
ps = push | |
psf = push --force | |
rbc = rebase --continue | |
rbhead = "!f() { git rebase -i HEAD~$1; }; f" | |
rbfrom = "!f() { git rebase -i $1; }; f" | |
showcdiff = "!f() { git log --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' $1..$2; }; f" | |
showremotes = remote -v | |
st = status | |
stageparts = add --patch | |
#stashall = stash save -u | |
stashall = stash apply --include-untracked | |
stashlastdel = stash drop | |
stashdelall = stash clear | |
stashlist = stash list | |
stashunapply = "!git stash show -p | git apply -R" | |
tree = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --branches --all | |
yank = cherry-pick | |
unstage = reset HEAD -- | |
unstagepatch = reset --patch |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-Aprire il file di configurazione di git sul vostro computer (solitamente quello global per MAC sta a /Users/[your_user_name]/.gitconfig)
-inserire la voce alias scrivendo [alias]
-schiaffarci bellamente la lista di alias che volete usare (come quella che vi ho appena pubblicato)
-salvare il file and enjoy!