-
Notifications
You must be signed in to change notification settings - Fork 4
Repository Management
neitsa edited this page Dec 17, 2016
·
5 revisions
We use Git subtree commands to handle the RemoteTech-Complete repository as it is composed of the other repositories in the RemoteTechnologiesGroup organisation.
First we need to add a remote for the subtree. The command is:
$ git remote add <friendly_name> <repo_url>
Example with RemoteTech-Common:
Neitsa@Falcon /RemoteTech-Complete (develop)``
$ git remote add RemoteTech-Common https://github.com/RemoteTechnologiesGroup/RemoteTech-Common.git
Next add the subtree to RemoteTech-Complete. The command is:
$ git subtree add --prefix=<location> <friendly_name> <branch> --squash
Where:
-
<location>is the location of the subtree insideRemoteTech-Common -
<friendly_name>is the name of the repository used in the previous step -
<branch>is the branch from which to get the code -
--squash: Always use this option to avoid polluting the history of the repository containing the subtree(s)
Example:
Neitsa@Falcon /RemoteTech-Complete (develop)
$ git subtree add --prefix=src/RemoteTech-Common RemoteTech-Common develop --squash
git fetch RemoteTech-Common develop
From https://github.com/RemoteTechnologiesGroup/RemoteTech-Common
* branch develop -> FETCH_HEAD
Added dir 'src/RemoteTech-Common'
If you need to update the subtree in RemoteTech-Complete, use the subtree pull command:
Neitsa@Falcon /RemoteTech-Complete (develop)
$ git subtree pull --prefix=<location> <friendly_name> <branch> --squash
Example:
Neitsa@Falcon /RemoteTech-Complete (develop)
$ git subtree pull --prefix=src/RemoteTech-Common RemoteTech-Common develop --squash