I have checked out a number of repo's and made a number of local fixes on my own branches.
I now want to add these repo's to my main project as I need to keep the changes but also potentially have the history associated with the third party repo's so that I can see what changes I've made.
This relies upon a branch being created in each third party repo so that you know exactly what you are using.
This is not subtree or submodules. It is a kind of hybrid sub-tree with each third party history in a separate branch. Note: only the single branch history is included.
I've not tested pulling/pushing from the third party repo's. At the moment all I want is to be able to see what my fixes are and what exactly is being used.
Note: gitkraken does not like the branches created.
Problems: git submodules in the imported directories are not setup. You have to manually find and fix.
- https://stackoverflow.com/questions/37775092/how-to-use-git-subtree-to-add-local-repo
- User dmg
# add remotegit remote add sub# fetch commitsgit fetch# create local branch with subgit checkout -b sub_branch sub/master# switch to mastergit checkout master# now, merge commit as a subdirectorygit read-tree --prefix=sub/ -u sub_branch
This is what I actually did:
git checkout mastergit remote add osgqt /home/damian/merge_test/ThirdParty_01/osgQt/.gitgit fetch osgqtgit checkout -b ThirdParty/osgQt osgqt/dd_branchgit checkout master
git read-tree --prefix=src/ThirdParty/osgQt/ -u ThirdParty/osgQtgit commitgit pushgit checkout ThirdParty/osgQtgit push origin HEAD:ThirdParty/osgQt
So after the above I see the following (in gitkraken):
Comments
Post a Comment