Skip to content

Commit 199d6ff

Browse files
committed
Merge pull request #33 from samarpanda/git-subtree
Git subtree usage!
2 parents 8746905 + 1f08b12 commit 199d6ff

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@
5656
* [Purnes branches that have been deleted in the remote.](https://github.com/git-tips/tips#purnes-branches-that-have-been-deleted-in-the-remote)
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)
59+
* [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](https://github.com/git-tips/tips#adding-a-project-to-repo-using-subtree)
61+
* [Get latest changes in your repo for a linked project using subtree](https://github.com/git-tips/tips#get-latest-changes-in-your-repo-for-a-linked-project-using-subtree)
5962

6063
<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
6164
<!-- @doxie.inject end toc -->
@@ -401,5 +404,20 @@ __Alternatives:__
401404
gitk --all
402405
```
403406

407+
## Deploying git tracked subfolder to gh-pages
408+
```sh
409+
git subtree push --prefix subfolder_name origin gh-pages
410+
```
411+
412+
## Adding a project to repo using subtree
413+
```sh
414+
git subtree add --prefix=<directory_name>/<project_name> --squash git@github.com:<username>/<project_name>.git master
415+
```
416+
417+
## Get latest changes in your repo for a linked project using subtree
418+
```sh
419+
git subtree pull --prefix=<directory_name>/<project_name> --squash git@github.com:<username>/<project_name>.git master
420+
```
421+
404422
<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
405423
<!-- @doxie.inject end -->

tips.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,5 +222,18 @@
222222
"title": "Visualize the version tree.",
223223
"tip": "git log --pretty=oneline --graph --decorate --all",
224224
"alternatives":["gitk --all"]
225+
},
226+
{
227+
"title": "Deploying git tracked subfolder to gh-pages",
228+
"tip": "git subtree push --prefix subfolder_name origin gh-pages",
229+
"alternatives": "git subtree push --prefix subfolder_name origin branch_name"
230+
},
231+
{
232+
"title": "Adding a project to repo using subtree",
233+
"tip": "git subtree add --prefix=<directory_name>/<project_name> --squash git@github.com:<username>/<project_name>.git master"
234+
},
235+
{
236+
"title": "Get latest changes in your repo for a linked project using subtree",
237+
"tip": "git subtree pull --prefix=<directory_name>/<project_name> --squash git@github.com:<username>/<project_name>.git master"
225238
}
226239
]

0 commit comments

Comments
 (0)