开发者

Git pull should ignore commits in unwanted branches

开发者 https://www.devze.com 2023-01-17 03:35 出处:网络
I\'m using two local repositories/working trees for our project development: one for the release version (bug-fixes only) and

I'm using two local repositories/working trees for our project development:

  • one for the release version (bug-fixes only) and
  • one for the continuing developme开发者_如何学Cnt in the master.

Hence I don't need to switch between branches back and forth.

We only merge changes from the release branch to the master, but not the opposite.

Is it possible to configure my release-repository/working tree to not fetch changes from the master?


You could specify remote refspec for fetch, in order to only fetch what you want.
See:

  • ProGit The Refspec.
  • In git, how do I check out a remote repository's remote branches? (for a practical example of git config remote.remote-name.fetch and git --add config remote.remote-name.fetch)

I am not sure, however, that you can specify "fetch everything but xxx".

If you don't want to fetch anything from your first (master) repo, maybe configuring the fetch directive with a non-existing branch name will server just that purpose.

0

精彩评论

暂无评论...
验证码 换一张
取 消