I'm trying to add a vim plugin in my settings repo as a git subtree. No matter where I try to pull the subtree to, git replies with an error: pathspec
I'm using the command below while at repos root directory:
git subtree add --prefix .vim/bundle/powerline powerline master --squash
which results in output:
git fetch powerline master
From git://github.com/Lokaltog/powerline
* branch master -> FETCH_HEAD
error: pathspec '.vim/bundle/powerline' did not match any file(s) known to git.
I'm using git version 2.0.3
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.
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.
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.
Splitting the Original Repository The subtree commands effectively take a folder and split to another repository. Everything you want in the subtree repo will need to be in the same folder.
I had exactly the same problem, turns out it was the "."
git subtree add --prefix ./cs/ControlLibrary/ ControlLibrary master --squash
Failed with:
error: pathspec './cs/ControlLibrary' did not match any file(s) known to git
but
git subtree add --prefix cs/ControlLibrary/ ControlLibrary master --squash
worked just fine :)
I am on Windows using ConEmu, not sure if that made any difference
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