Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### I would always recommend to add aliases into global git configuration
- # 👊🏻 Rebase current branch on master
- alias.ready=!git checkout master && git pull && git checkout - && git rebase master
- # ❓ Get distance of commits against master. Useful before rebasing
- alias.distance=!git rev-list origin/master.. --count
- # 🔩 Squash commits against master with the count of distance to master branch
- alias.squash=!git rebase -i HEAD~`git rev-list origin/master.. --count`
- # ☠️ Force commits and pushes the changes skipping pre commits and pre push hooks. Useful before going home ☺️
- alias.cmp=!f() { git add -A && git commit -m "$@" --no-verify && git push -f --no-verify origin HEAD; }; f
- # 🗑️ Remove local branch and checkout fresh one from the remote
- alias.cbr=!f() { git checkout master && git fetch && git branch -D "$1" && git checkout "$1"; }; f
Add Comment
Please, Sign In to add comment