Skip to content

Commit 8e73868

Browse files
committed
pull changes of subproject using git subtree
1 parent b31618b commit 8e73868

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@
5757
* [Retrieve the commit hash of the initial revision.](https://github.com/git-tips/tips#retrieve-the-commit-hash-of-the-initial-revision)
5858
* [Visualize the version tree.](https://github.com/git-tips/tips#visualize-the-version-tree)
5959
* [Deploying git tracked subfolder to gh-pages](https://github.com/git-tips/tips#deploying-git-tracked-subfolder-to-gh-pages)
60-
* [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)
60+
* [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)
61+
* [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)
6162

6263
<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
6364
<!-- @doxie.inject end toc -->
@@ -408,10 +409,15 @@ gitk --all
408409
git subtree push --prefix subfolder_name origin gh-pages
409410
```
410411

411-
## Adding a project to repo using subtree. Lets say we are adding in vendor directory
412+
## Adding a project to repo using subtree. For example we are adding in vendor directory
412413
```sh
413414
git subtree add --prefix=vendor/<project_name> --squash git@github.com:<username>/<project_name>.git master
414415
```
415416

417+
## Get latest changes in your repo for a linked subproject using subtree. For example we have the subproject in vendor directory
418+
```sh
419+
git subtree pull --prefix=vendor/<project_name> --squash git@github.com:<username>/<project_name>.git master
420+
```
421+
416422
<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
417423
<!-- @doxie.inject end -->

tips.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,11 @@
229229
"alternatives": "git subtree push --prefix subfolder_name origin branch_name"
230230
},
231231
{
232-
"title": "Adding a project to repo using subtree. Lets say we are adding in vendor directory",
232+
"title": "Adding a project to repo using subtree. For example we are adding in vendor directory",
233233
"tip": "git subtree add --prefix=vendor/<project_name> --squash git@github.com:<username>/<project_name>.git master"
234+
},
235+
{
236+
"title": "Get latest changes in your repo for a linked subproject using subtree. For example we have the subproject in vendor directory",
237+
"tip": "git subtree pull --prefix=vendor/<project_name> --squash git@github.com:<username>/<project_name>.git master"
234238
}
235239
]

0 commit comments

Comments
 (0)