From 8e7386807595e7f464cbe623d7ff99db04f58d34 Mon Sep 17 00:00:00 2001 From: Samar Panda Date: Wed, 2 Sep 2015 20:10:26 +0530 Subject: [PATCH] pull changes of subproject using git subtree --- README.md | 10 ++++++++-- tips.json | 6 +++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a34b6c0..e7a72eb 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,8 @@ * [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) +* [Adding a project to repo using subtree. For example we are adding in vendor directory](https://github.com/git-tips/tips#adding-a-project-to-repo-using-subtree-for-example-we-are-adding-in-vendor-directory) +* [Get latest changes in your repo for a linked subproject using subtree. For example we have the subproject in vendor directory](https://github.com/git-tips/tips#get-latest-changes-in-your-repo-for-a-linked-subproject-using-subtree-for-example-we-have-the-subproject-in-vendor-directory) @@ -408,10 +409,15 @@ 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 +## Adding a project to repo using subtree. For example we are adding in vendor directory ```sh git subtree add --prefix=vendor/ --squash git@github.com:/.git master ``` +## Get latest changes in your repo for a linked subproject using subtree. For example we have the subproject in vendor directory +```sh +git subtree pull --prefix=vendor/ --squash git@github.com:/.git master +``` + diff --git a/tips.json b/tips.json index 41177f9..c330dbc 100644 --- a/tips.json +++ b/tips.json @@ -229,7 +229,11 @@ "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", + "title": "Adding a project to repo using subtree. For example we are adding in vendor directory", "tip": "git subtree add --prefix=vendor/ --squash git@github.com:/.git master" + }, + { + "title": "Get latest changes in your repo for a linked subproject using subtree. For example we have the subproject in vendor directory", + "tip": "git subtree pull --prefix=vendor/ --squash git@github.com:/.git master" } ]