Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git subtree add does not accept pathspec

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

like image 780
user917938 Avatar asked Aug 03 '14 08:08

user917938


People also ask

How do you push to a subtree?

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.

How do I create a subtree in git?

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.

How does git subtree work?

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.

What is git subtree split?

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.


1 Answers

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

like image 90
chrispepper1989 Avatar answered Oct 16 '22 03:10

chrispepper1989