문제

I have branches

v1.0
v1.1
v1.2
v1.3
v1.4 [master]

now i checkout the v1.0 and add some directory with files (db tables, stored procedures, etc)

how to merge the newly added directory with files in all branches so my head branch will be updated with that directory

도움이 되었습니까?

해결책

I guess you need just that particular directory and no other changes which were introduced in different branches, if that is the case then, one way which comes to my mind right now is git cherry-pick.

Just check git log and find out the commit id responsible for adding that new directory and everything else you need. Now checkout your other branches one by one and use

git cherry-pick <commid id>

And that particular commit will be applied to that respective branch.

다른 팁

I think you need to manually merge the updated branch to rest of the branches. Just commit the directory and other files on one of the branches (say you made the commit on v1.0)

To merge a branch (v.10 to v1.1) you can do

Assume you are on v1.0 branch,

git checkout v1.1
git merge v1.0

(assuming you are on branch 1.4) git push origin 1.4

git checkout 1.3 git pull --rebase origin git merge 1.4

Resolve conflicts git add conflicted-file

git commit

git push origin 1.3

Repeat this for all other branches.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top