Skip to content

Instantly share code, notes, and snippets.

@HirogaKatageri
Last active September 21, 2022 23:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save HirogaKatageri/752a39c5a36442031641c2ac063ed107 to your computer and use it in GitHub Desktop.
Save HirogaKatageri/752a39c5a36442031641c2ac063ed107 to your computer and use it in GitHub Desktop.
Shell Script Commands: Git Shortcuts
# Add the following line to your ~/.bashrc or where your other shell commands are at.
# git.ignore: Untracks ignored files in Git.
# git.prune: Deletes local merged branches on current branch. It protects: (master, main, develop)
alias git.ignore='git add . && git commit -m "Committing all changes..." && git rm -r --cached . && git add . && git commit -m "Removing ignored tracked files..."'
alias git.prune='git branch --merged | egrep -v "(^\*|master|main|develop)" | xargs git branch -d'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment