First of all. Make sure to have your sub-repository initialized and ready. If you don't have one, open a terminal, go to your projects root folder and run
git init
Add your subtree project
git subtree add --prefix matgui git@github.com:mls-m5/matgui.git master --squash
where the --squash parameter makes sure that you only checkout a shallow copy of the subrepository
One thing i noticed when doing this was that you need to commit or stash all your changes before adding the subtree so that you have a clean repository to work with.
This will add a reference to the place where you got the code from
If you want to pull down changes to your project you then just have to use
git pull -s subtree matgui master
Save the repository to be able to update it later on
git remote add -f matgui git@github.com:mls-m5/matgui.git
If you want to pull down changes to your project you then just have to use
git pull -s subtree matgui master
Inga kommentarer:
Skicka en kommentar