Home > front end >  Is there a way to set `pull.rebase = true` only for one specific branch?
Is there a way to set `pull.rebase = true` only for one specific branch?

Time:11-03

Normally, I have pull.rebase = false set globally. However, I am working on a project where I specifically want to enable pull.rebase = true only for the main branch. I know that I can manually write git pull --rebase, but I don't want to forget to do it.

I also don't want to set pull.rebase = true for the entire repo, because I don't always (or even usually) want to do a rebase pull.

Is there some way to set this on a per-branch basis?

CodePudding user response:

There is a per branch configuration parameter branch.<name>.rebase :

git config branch.my/branch.rebase true
  •  Tags:  
  • git
  • Related