From Genome Analysis Wiki
Jump to navigationJump to search
246 bytes added
, 18:01, 1 September 2015
Line 246: |
Line 246: |
| | | |
| == Subtrees == | | == Subtrees == |
− | === Remote is not a part of this git repo: Add the branch === | + | === Bring in changes from a subtree's remote === |
− | Add it:
| + | If the remote is not already a part of this git repo: |
− | #Add other project as a branch and fetch (-f) | + | #Add other project as a branch and fetch (-f). |
− | #:git remote add -f libStatGen_remote https://github.com/statgen/libStatGen.git | + | #:<code>git remote add -f libStatGen_remote https://github.com/statgen/libStatGen.git</code> |
− | #Create & checkout a branch for the remote | + | #Create & checkout a branch for the remote. |
− | #:git checkout -b libStatGen_branch libStatGen_remote/master | + | #* taking <code>master</code>: |
| + | #: <code>git checkout -b libStatGen_branch libStatGen_remote/master</code> |
| + | #* taking a tag: |
| + | #: <code>git checkout -b vt_branch_SWS tags/SWS</code> |
| | | |
− | === Remote is part of this git repo: Bring in the latest version ===
| + | If the remote is already a part of this git repo: |
| #Checkout the branch | | #Checkout the branch |
− | #:git checkout libStatGen_branch | + | #: <code>git checkout libStatGen_branch</code> |
| #Bring in the new version | | #Bring in the new version |
− | #:git pull | + | #: <code>git pull</code> |
| | | |
| === Merge the changes from the subtree into the base repository === | | === Merge the changes from the subtree into the base repository === |
| #Go back to the master branch | | #Go back to the master branch |
− | #:git checkout master | + | #: <code>git checkout master</code> |
| #(Optional) Only if adding a new subdirectory, do: | | #(Optional) Only if adding a new subdirectory, do: |
− | #:git read-tree --prefix=src/libStatGen -u libStatGen_branch | + | #: <code>git read-tree --prefix=src/libStatGen -u libStatGen_branch</code> |
− | #Merge in the new version. --squash: do not merge histories; -s: merge strategy; --no-commit: just merge, don’t commit the changes | + | #Merge in the new version. |
− | #:git merge --squash -s subtree --no-commit libStatGen_branch
| + | #: <code>git merge --squash -s subtree --no-commit libStatGen_branch</code> |
| + | #:* --squash: do not merge histories |
| + | #:* -s subtree: merge strategy |
| + | #:*--no-commit: just merge, don’t commit the changes |
| #Commit the changes | | #Commit the changes |
− | #:git commit -m “message” | + | #: <code>git commit -m “message”</code> |