From Genome Analysis Wiki
Jump to navigationJump to search
958 bytes added
, 08:05, 31 October 2013
Line 243: |
Line 243: |
| git checkout branch_you_want | | git checkout branch_you_want |
| git commit | | git commit |
| + | |
| + | |
| + | == Subtrees == |
| + | === Remote is not a part of this git repo: Add the branch === |
| + | Add it: |
| + | #Add other project as a branch and fetch (-f) |
| + | #:git remote add -f libStatGen_remote https://github.com/statgen/libStatGen.git |
| + | #Create & checkout a branch for the remote |
| + | #:git checkout -b libStatGen_branch libStatGen_remote/master |
| + | |
| + | === Remote is part of this git repo: Bring in the latest version === |
| + | #Checkout the branch |
| + | #:git checkout libStatGen_branch |
| + | #Bring in the new version |
| + | #:git pull |
| + | |
| + | === Merge the changes from the subtree into the base repository === |
| + | #Go back to the master branch |
| + | #:git checkout master |
| + | #(Optional) Only if adding a new subdirectory, do: |
| + | #:git read-tree --prefix=src/libStatGen -u libStatGen_branch |
| + | #Merge in the new version. --squash: do not merge histories; -s: merge strategy; --no-commit: just merge, don’t commit the changes |
| + | #:git merge --squash -s subtree --no-commit libStatGen_branch |
| + | #Commit the changes |
| + | #:git commit -m “message” |