Last active
November 4, 2021 14:30
-
-
Save jadenlemmon/87587e4d1ba21bddace80d0b092ca407 to your computer and use it in GitHub Desktop.
Git alias config file
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] | |
branch-name = "!git rev-parse --abbrev-ref HEAD" | |
c = checkout | |
cb = checkout -b | |
s = status | |
# push the current branch | |
pub = "!git push -u origin $(git branch-name)" | |
# open a pr in github | |
open = "!f() { open \"$(git ls-remote --get-url $(git config --get branch.$(git branch --show-current).remote) | sed 's|[email protected]:\\(.*\\)$|https://github.com/\\1|' | sed 's|\\.git$||')/compare/$(git config --get branch.$(git branch --show-current).merge | cut -d / -f 3-)?expand=1\"; }; f" | |
last = log -1 HEAD --stat | |
# shorthand add all files and commit | |
ac = "!f() { git add .; git commit -m \"$*\"; };f" | |
# add all files with a random commit msg | |
rc = "!git add -A && git commit -am \"$(curl -s http://whatthecommit.com/index.txt)\"" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment