Skip to content

Instantly share code, notes, and snippets.

@dlgg
Created August 9, 2013 06:30
Show Gist options
  • Save dlgg/6191552 to your computer and use it in GitHub Desktop.
Save dlgg/6191552 to your computer and use it in GitHub Desktop.
Git subtree for integration of an external repository inside a project

Sub-tree

This is only a memo for sub-tree integration of Dropbox SDK from is own repository.

Installation of sub tree (at the root of the project) :

    git remote add db_sdk_remote git@github.com:dlgg/DropboxTCL.git
    git fetch db_sdk_remote
    git checkout -b dropbox db_sdk_remote/master
    git checkout master
    git read-tree --prefix=includes/dropbox/ -u dropbox
    git pull -s subtree db_sdk_remote master (if it doesn't work : git checkout dropbox; git pull; git checkout master)
    git merge --squash -s subtree --no-commit dropbox

Update of dropbox sdk :

    git pull -s subtree db_sdk_remote master

Check if need to update dropbox sdk :

    git diff-tree -p dropbox
    git diff-tree -p db_sdk_remote/master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment