shadowtalker
shadowtalker

Reputation: 13903

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

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?

Upvotes: 0

Views: 380

Answers (1)

LeGEC
LeGEC

Reputation: 52081

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

git config branch.my/branch.rebase true

Upvotes: 4

Related Questions