Skip to content

Instantly share code, notes, and snippets.

@Elijas
Last active July 18, 2023 08:23
Show Gist options
  • Save Elijas/e8680415d620cd16f95c2e6725a6afa5 to your computer and use it in GitHub Desktop.
Save Elijas/e8680415d620cd16f95c2e6725a6afa5 to your computer and use it in GitHub Desktop.
Convenient git aliases
# no capitalization
git config --global alias.s '!git status'
git config --global alias.pp '!git pull --no-edit && git push'
git config --global alias.c '!sh -c "git commit -m \"$*\" && git pull --no-edit && git push" -'
git config --global alias.ac '!sh -c "git add -A && git commit -m \"$*\" && git pull --no-edit && git push" -'
git config --global alias.nac '!sh -c "nbdev_prepare && git add -A && git commit -m \"$*\" && git pull --no-edit && git push" -'
# with first letter capitalization
git config --global alias.s '!git status'
git config --global alias.pp '!git pull --no-edit && git push'
git config --global alias.c '!f() { git commit -m "$(echo $* | awk '\''{ $1=toupper(substr($1,1,1)) substr($1,2) }1'\'' )"; git pull --no-edit && git push; }; f'
git config --global alias.ac '!f() { git add -A && git commit -m "$(echo $* | awk '\''{ $1=toupper(substr($1,1,1)) substr($1,2) }1'\'' )"; git pull --no-edit && git push; }; f'
git config --global alias.nac '!f() { nbdev_prepare && git add -A && git commit -m "$(echo $* | awk '\''{ $1=toupper(substr($1,1,1)) substr($1,2) }1'\'' )"; git pull --no-edit && git push; }; f'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment