DEV Community

Discussion on: Fed up with Git conflicts😤?: Rebase regularly and chill!

Collapse
 
cyberhck profile image
Nishchal Gautam

me personally, if there's a update thing on PR, I simply run:

gcm && ggpull && git checkout <my-branch> && git rebase master
Enter fullscreen mode Exit fullscreen mode

fix any conflicts, then:

ggpush --force
Enter fullscreen mode Exit fullscreen mode

note: I'm using zsh shell with oh-my-zsh which has aliases:

  • gcm = git checkout master
  • ggpull = git pull origin
  • ggpush = git push origin

And at last I haven't setup on my new machine, but will do soon:
alias rbm = gcm && ggpull && git checkout <current branch> && git rebase master (rebase branch to master)

The there's a interpolation you can use for getting current branch :) I think I'll have to modify above, but should give general idea.

Collapse
 
maulik profile image
Maulik

Thanks @cyberhck for sharing