If I do this in one of my repositories:
git subtree pull --prefix=frameworks/AquaticPrime --squash AquaticPrime
I get this:
Working tree has modifications. Cannot add.
If I do this (in the same place, of course):
git status
I get this:
# On branch master nothing to commit (working directory clean)
I'm not quite sure what's going on here. The git status command implies that I don't have modifications, so I'm assuming that the git subtree pull is referring to modifications in a different branch related to the subtree, but it's not entirely clear.
Can anyone provide enlightenment?
git subtree allows you to nest a repository as a subdirectory inside another. It's one of the various options for managing project dependencies in Git projects. You add a subtree to an existing repository where the subtree is a reference to another repository URL and branch/tag when you wish to utilize it.
Adding a subtreeSpecify the prefix local directory into which you want to pull the subtree. Specify the remote repository URL [of the subtree being pulled in] Specify the remote branch [of the subtree being pulled in] Specify you want to squash all the remote repository's [the subtree's] logs.
subtree : push: allow specifying a local rev other than HEAD ' git push '(man) lets you specify a mapping between a local thing and a remot ref. So smash those together, and have git subtree push let you specify which local thing to run split on and push the result of that split to the remote ref.
I just had the same problem. From GIT source, error is thrown when command git diff-index HEAD
returns result, even if git status
says working tree is clean.
To avoid this error, in my case, I re-checkout the current branch of working tree , and everything seems OK : git checkout <branch>
It's a bit confused, but if someone can explain why ...
git reset --hard
fixed it to me
From git reset --help
--hard Resets the index and working tree. Any changes to tracked files in the working tree since are discarded.
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