Skip to content

Instantly share code, notes, and snippets.

@itse4elhaam
Last active January 17, 2024 18:34
Show Gist options
  • Save itse4elhaam/864a607e862c1adaf578ff00f480dfab to your computer and use it in GitHub Desktop.
Save itse4elhaam/864a607e862c1adaf578ff00f480dfab to your computer and use it in GitHub Desktop.
Git aliases
[alias]
ac = !git add -A && git commit -m
acp = "!f() { git add -A && git commit -m \"$1\" && git push origin $(git symbolic-ref --short HEAD); }; f"
pom = push origin master
po = push origin
pl = pull origin
st = status -sb
s = status
co = checkout
br = branch --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(contents:subject) %(color:green)(%(committerdate:relative)) [%(authorname)]' --sort=-committerdate
ll = log --oneline
last = log -1 HEAD --stat
fo = fetch origin
fa = fetch --all
rh = reset --hard
plc = "!git pull origin $(git symbolic-ref --short HEAD)"
poc = "!git push origin $(git symbolic-ref --short HEAD)"
cbr = "!f() { echo 'Current branch:' && git rev-parse --abbrev-ref HEAD && git rev-parse --abbrev-ref HEAD | $(command -v clip || command -v xclip || command -v pbcopy); }; f"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment