When clicking branches and tags you get an error: git cannot appear: there is no such file or directory

I have an existing, open, Git repository created from importing our source and history from CVS. I am making a mirror using:

git clone --mirror git://aserver.adomain.com/myrepo 

Then I want to direct all branches and tags to our internal Git repo host, but clicking does not seem like the bare repository looks like a git repo .

I tried the following:

 git clone --mirror git://aserver.adomain.com/myrepo git remote set-url origin http:// user@anotherserver.adomain.com /project/myrepo.git git push origin 

that leads to:

 $ git push origin Password for 'xxxx': error: cannot spawn git: No such file or directory 

or am I trying:

 $ git remote rm origin Note: Some branches outside the refs/remotes/ hierarchy were not removed; to delete them, use: ...a whole lot of branches... user@SOMEMACHINE /some/path/myrepo.git (BARE:master) $ ls HEAD config description hooks info objects packed-refs refs user@SOMEMACHINE /some/path/myrepo.git (BARE:master) $ git branch -a ...a whole lot of local branches... user@SOMEMACHINE /some/path/myrepo.git (BARE:master) $ git remote add mygithost http:// user@anotherserver.adomain.com /project/myrepo.git user@SOMEMACHINE /some/path/myrepo.git (BARE:master) $ git push --all mygithost Password for 'xxxx': error: cannot spawn git: No such file or directory 

What is the meaning of "can not spawn git"?

How can I push an open repo with all branches to an empty existing one?

I have several possibilities and examined several SO problems, but I do not see a solution to this problem. It is clear that my understanding of this process is erroneous.

Update

I think my understanding was not a mistake. The error somehow misled me to think that something was wrong with the open repository, since I could clone and push the branch along the branch exactly from "ordinary" clones.

As it turned out, this is a bug in MSysGit. I switched to Linux because preserving my history was mandatory, in my case. I couldn’t just delete the branches and tags, since they had to click on an empty remote repo. So the following:

 $ git remote rm origin $ git clone --mirror git://aserver.adomain.com/myrepo $ cd /some/path/myrepo.git $ git remote add mygithost http:// user@anotherserver.adomain.com /project/myrepo.git $ git push --all mygithost $ git push --tags mygithost 
+4
source share
4 answers

Since this comment led to a solution (see edit at the end of the question), here it is sent in response as an answer:

Do you use MSysGit? This is known to happen if you have a large number of tags. See this post .

+7
source

According to this post , the main problem is that git does not work correctly if installed in a directory with spaces in the path. This corresponds to my environment where I encountered an error and an error message.

I assume this behavior is not surprising given that git was originally written by a Linux author. A typical workaround is to use an operating system that is hostile to spaces in path names.

0
source

I also have this problem due to the large number of tags when using git on Windows. I solved this by making a script package that pushed some of the tags one at a time until the number of tags was below 500. Then I managed to do git push , which took a while to complete, but it worked.

So, you just simply open the notebook, write git push origin <yourtagname> for each tag you want to click, one per line, save it as blabla.bat in the git repository folder and run it. It’s even easier if you just copy all the file names from the .git\refs\tags tag folder and do some replacement magic to add git push origin in front of each file name.

0
source

I ran into the same problem (I cannot call git: there is no such file or directory) when I tried to click on the stash / bitbucket git server, some big project exported from TFS (to the local pc git folder). There was one branch and many tags (3K + tags). The problem occurs when you click the command for all tags, and clicking one tag works fine. I am using GitExtensions (based on msysgit) and the connection to the remote is http.

The solution suddenly wound up: I reconfigured my git to use an SSH connection to the remote rather than http , and this miraculously solves the problem: clicking all the tags was successful.

0
source

All Articles