diff --git a/README.md b/README.md index eb2df77..a34b6c0 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,7 @@ * [Retrieve the commit hash of the initial revision.](https://github.com/git-tips/tips#retrieve-the-commit-hash-of-the-initial-revision) * [Visualize the version tree.](https://github.com/git-tips/tips#visualize-the-version-tree) * [Deploying git tracked subfolder to gh-pages](https://github.com/git-tips/tips#deploying-git-tracked-subfolder-to-gh-pages) +* [Adding a project to repo using subtree. Lets say we are adding in vendor directory](https://github.com/git-tips/tips#adding-a-project-to-repo-using-subtree-lets-say-we-are-adding-in-vendor-directory) @@ -407,5 +408,10 @@ gitk --all git subtree push --prefix subfolder_name origin gh-pages ``` +## Adding a project to repo using subtree. Lets say we are adding in vendor directory +```sh +git subtree add --prefix=vendor/ --squash git@github.com:/.git master +``` + diff --git a/tips.json b/tips.json index 33b34f3..41177f9 100644 --- a/tips.json +++ b/tips.json @@ -227,5 +227,9 @@ "title": "Deploying git tracked subfolder to gh-pages", "tip": "git subtree push --prefix subfolder_name origin gh-pages", "alternatives": "git subtree push --prefix subfolder_name origin branch_name" + }, + { + "title": "Adding a project to repo using subtree. Lets say we are adding in vendor directory", + "tip": "git subtree add --prefix=vendor/ --squash git@github.com:/.git master" } ]