Skip to content

Instantly share code, notes, and snippets.

@cybernetics
Forked from natescode/.gitconfig
Created July 13, 2022 03:38
Show Gist options
  • Save cybernetics/0fd08626be67498c6724ab53bc7f3ab2 to your computer and use it in GitHub Desktop.
Save cybernetics/0fd08626be67498c6724ab53bc7f3ab2 to your computer and use it in GitHub Desktop.
Git Aliases to make GIT easier to work with
[user]
email = your_email
name = your_username
[alias]
s = status~
co = checkout
cob = checkout -b
feat = "!f(){ git cob feature/${1}; };f"
del = branch -D
br = branch --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(contents:subject) %(color:green)(%(committerdate:relative)) [%(authorname)]' --sort=-committerdate
save = !git add -A && git commit -m
undo = reset HEAD~1 --mixed
wipe = !git reset --hard
done = !git push origin HEAD
logs = !git log --pretty=format:\"%C(magenta)%h%Creset -%C(red)%d%Creset %s %C(dim green)(%cr) [%an]\" --abbrev-commit -30
last = log -1 HEAD
cm = commit -m
ci = commit
st = stash
pop = stash pop
apply = stash apply
conf = config --global
wip = commit -am "WIP"
amend = commit -a --amend
squash = "!f(){ git reset --soft HEAD~${1} && git commit --edit -m\"$(git log --format=%B --reverse HEAD..HEAD@{1})\"; };f"
unstage = restore --staged
syncod = !git fetch --all && git merge origin/develop
sync = "!f(){ git fetch --all && git merge origin/${1}; };f"
dev = !git checkout develop
master = !git checkout master
main = !git checkout main
rao = "!f(){ git remote add origin${1} && git push -u; };f"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment