Skip to content

Instantly share code, notes, and snippets.

@mijdavis2
Last active May 22, 2021 14:15
Show Gist options
  • Save mijdavis2/16e545d14e78eb97b5718fdb3620d244 to your computer and use it in GitHub Desktop.
Save mijdavis2/16e545d14e78eb97b5718fdb3620d244 to your computer and use it in GitHub Desktop.
Git config - helpful aliases
[core]
editor = vim
[alias]
reup = !git stash && git fetch && git rebase origin/master && git stash pop
au = !git add -u && git fetch >/dev/null && git diff --cached --no-ext-diff origin/master | grep --color=always 'pdb.set_trace()' -B 6
re = reset
dc = diff --cached
st = status
co = checkout
cob = checkout -b
com = commit
cm = commit -m
br = branch
sup = submodule update
save = !git add -A && git commit -m "SAVEPOINT"
wip = !git add -u && git commit -m "WIP"
undo = reset HEAD~1 --mixed
amend = commit -a --amend
wipe = !git add -A && git commit -qm "WIPE SAVEPOINT" && git reset HEAD~1 --hard
pub = "!git push -u origin $(git branch-name)"
branch-name = "!git rev-parse --abbrev-ref HEAD"
upstream = "!git rev-parse --abbrev-ref $(git branch-name)@{upstream}"
grepall = !"grepall() { git grep $* $(git rev-list --all); }; grepall"
ignore=!([ ! -e .gitignore ] && touch .gitignore) | echo $1 >>.gitignore
cleanup = "!git branch --merged | grep -v '\\*\\|master\\|develop\\|main' | xargs -n 1 git branch -d"
scleanup = "!git co master; git pull origin master; git-delete-squashed;"
sha = "rev-parse HEAD"
ontop = "!git fetch; git rebase origin/master"
[pull]
ff = only
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment