Skip to content

Instantly share code, notes, and snippets.

@cdkamat
Last active December 16, 2015 11:18
Show Gist options
  • Save cdkamat/5425865 to your computer and use it in GitHub Desktop.
Save cdkamat/5425865 to your computer and use it in GitHub Desktop.
git subtree add
Used this
# Adding a repository as a subtree to your current repository
$ git subtree add --prefix=path/in/curr/repo \
git://github.com/yourname/your-repo.git master
git log has entry and histories (i.e all commits) of both repositories
commit d0b0cdeeb29d4512c7426e8f1680505aa3f3c03c
Merge: 05b3ec0 70cf968
Author: Chinmay Kamat <chinmaykamat@gmail.com>
Date: Sat Apr 20 00:08:24 2013 -0400
Add 'compiler_node/' from commit '70cf96847238291664a5bd56a01442580bc6f945'
git-subtree-dir: compiler_node
git-subtree-mainline: 05b3ec0b80321b22c52d9592ad7481f46621ff54
git-subtree-split: 70cf96847238291664a5bd56a01442580bc6f945
All files inside compiler_node show log as --
$ git log compiler_node/message.py
commit d0b0cdeeb29d4512c7426e8f1680505aa3f3c03c
Merge: 05b3ec0 70cf968
Author: Chinmay Kamat <chinmaykamat@gmail.com>
Date: Sat Apr 20 00:08:24 2013 -0400
Add 'compiler_node/' from commit '70cf96847238291664a5bd56a01442580bc6f945'
git-subtree-dir: compiler_node
git-subtree-mainline: 05b3ec0b80321b22c52d9592ad7481f46621ff54
git-subtree-split: 70cf96847238291664a5bd56a01442580bc6f945
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment