开发者

How to split local changes from main project and subtree libraries

开发者 https://www.devze.com 2023-02-23 17:31 出处:网络
In my project I have 3 subdirectory with library projects merged by subtree strategy. Suppose I checkout master branch and make changes in main project as well as in libraries files. I can\'t checkout

In my project I have 3 subdirectory with library projects merged by subtree strategy. Suppose I checkout master branch and make changes in main project as well as in libraries files. I can't checkout any lib branch because I will lose local changes. Run stash in one branch and apply it in another is not good idea.

How to split changes and commit it in right branches using only standard git tools (without开发者_JAVA百科 any git-subtree packages)???


You can use different working directories. ie:

git clone x main_project
git clone x lib1
git clone x lib2

A better way would be to use git-new-workdir script that's in git/conrib as Paulo Ebermann above has pointed out. You can find more information on how to use it over here: http://nuclearsquid.com/writings/git-new-workdir.html

0

精彩评论

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