Guest User

Untitled

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