Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
401 views
in Technique[技术] by (71.8m points)

pull - Using Git how to merge a subtree from remote branch

Subtrees in Git work nicely although some git commands remain to be supported for subtrees.

Here's the question:

How to make the subtree pull from a different remote branch like "stable" or "integrate"?


FYI, we have a subtree "push" working as a script. In fact, it can even push the subtree to the specific branch of our choice on the remote repository.

Does anybody know how to do the reverse on a pull or even have a clue?

The simple pull works like this:

git pull -s subtree remotebranch

One idea that can be tried: Maybe a 2-step process will do the trick.

  1. The remote branch gets pulled from remote repository branch like "stable" and then
  2. do the git subtree pull to master?

Sincerely, Wayne

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

May be (not tested) the git subtree script tool may help here.
See its man page

It can merge/pull a subproject in your own repo, but it may concern all branches, so your two-step process could still be needed.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

56.9k users

...