Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how about using the "git subtree" to join repos? #3

Open
lhrkkk opened this issue May 25, 2017 · 1 comment
Open

how about using the "git subtree" to join repos? #3

lhrkkk opened this issue May 25, 2017 · 1 comment

Comments

@lhrkkk
Copy link

lhrkkk commented May 25, 2017

git subtree can join multi repos together and can push them back, is it a little better ?

@adrian1001
Copy link

Depends on your use case. For importing libraries into your project git subtree is probably the better solution.

One downside of git subtree is that the history is not visible for the files under the "--prefix" sub-directory.

Example:
git init new-repo
cd new-repo
git commit --allow-empty -m "Intial, empty commit"
git subtree add --prefix=repo1 [email protected]:username/repo1.git master
git subtree add --prefix=repo2 [email protected]:username/repo2.git master

The imported history can be seen allright by
git log --oneline --all

However, if you try to look up the history of some specific file, you'll only see the subtree add commit:
git log --oneline --all repo1/
655d1004 Add 'repo1/' from commit '3ff71f86ddfee07c00021f82f078d01460a0a314'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants