When I enter > git subtree add --prefix=<some dir> --squash <some repo> master
I receive the message 'master' does not refer to a commit
. If I change 'master' to a sha I still get a warning. The repo is valid and master exists in the repo that I am trying to pull in.
git subtree lets you nest one repository inside another as a sub-directory. It is one of several ways Git projects can manage project dependencies. Why you may want to consider git subtree. Management of a simple workflow is easy.
Git commits are one of the key parts of a Git repository, and more so, the commit message is a life log for the repository. As the project/repository evolves over time (new features getting added, bugs being fixed, architecture being refactored), commit messages are the place where one can see what was changed and how.
I eventually found this commit and the important bit of information is
This patch:
- relaxes the check the argument in "git subtree add " (previous code would not accept a ref name that does not exist locally too, new code only ensures that the ref is well formatted)
My problem was that my local repo does not have a branch named master (semantic versioning). The simple workaround was to create a local branch named master (or whatever the name of the branch that you are trying to pull from is. That resolves the issue seen here: Adding git subtree from a branch Geoff Ryan could have created a local branch named cow and successfully used subtree)
This should hopefully be resolved by git 1.9 but, for anyone using an earlier version, I hope that this saves you some frustration.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With