edthamm

.gitconfig

Dec 3rd, 2018
257
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.58 KB | None | 0 0
  1. # Stole this stuff from all over the internet over the last few years.
  2. # Thanks to everyone working hard on these things.
  3. [alias]
  4.     # Workflow
  5.     cl = clone
  6.     up = !git pull --rebase --prune $@ && git submodule update --init --recursive
  7.     co = checkout
  8.     cob = checkout -b
  9.     ca = !git add -A && git commit -m
  10.     cm = commit -am
  11.     ci = commit --interactive
  12.     amend = commit -a --amend
  13.     unstage = reset HEAD --
  14.     # Moving aroud
  15.     br = branch
  16.     brs = branch -a
  17.     # Merging and such things
  18.     cp = cherry-pick
  19.     stashes = stash list
  20.     pop = stash pop
  21.     ours = !"f() { git checkout --ours $@ && git add $@; }; f"
  22.     theirs = !"f() { git checkout --theirs $@ && git add $@; }; f"
  23.     # Logs and status
  24.     st = status -sb
  25.     dc = diff --cached
  26.     last = log -1 --stat
  27.     lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %Cblue<%an>%Creset' --abbrev-commit --date=relative --all
  28.     lol = log --graph --decorate --pretty=oneline --abbrev-commit
  29.     lola = log --graph --decorate --pretty=oneline --abbrev-commit --all --date=local
  30.     # Github Flow
  31.     bclean = "!f() { git checkout ${1-develop} && git branch --merged ${1-develop} | grep -v " ${1-develop}$" | xargs git branch -d; }; f"
  32.     bdone = "!f() { git checkout ${1-develop} && git up && git bclean ${1-develop}; }; f"
  33.     # Repository optimization
  34.     pruner = !git prune --expire=now; git reflog expire --expire-unreachable=now --rewrite --all
  35.     repacker = !git repack -a -d -f --depth=300 --window=300 --window-memory=1g
  36.     # Dangerous
  37.     wipe = !git add -A && git commit -qm 'WIPE SAVEPOINT' && git reset HEAD~1 --hard
  38.     killit = reset HEAD --hard
Advertisement
Add Comment
Please, Sign In to add comment