Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

command failed: 2>&1 git checkout -f master #90

Closed
moreaki opened this issue Oct 31, 2012 · 27 comments
Closed

command failed: 2>&1 git checkout -f master #90

moreaki opened this issue Oct 31, 2012 · 27 comments

Comments

@moreaki
Copy link

moreaki commented Oct 31, 2012

I must be too dumb for the existing svn2git solutions, since I have started with

http://john.albin.net/git/convert-subversion-to-git

proceeded to

https://github.com/JohnAlbin/git-svn-migrate

and am now trying to import a simple (what appears to be a standard) svn project using your approach with snv2git, which quits my attempts with a nonchalant 'command failed':

$ svn2git http://apt-cyg.googlecode.com/svn  --verbose
Running command: git svn init --prefix=svn/ --no-metadata --trunk=trunk --tags=tags --branches=branches http://apt-cyg.googlecode.com/svn
Running command: git svn fetch 
Running command: git branch -l --no-color
Running command: git branch -r --no-color
Running command: git config --local --get user.name
Running command: git config --local --get user.email
Running command: git checkout -f master
error: pathspec 'master' did not match any file(s) known to git.
command failed:
2>&1 git checkout -f master

The same happens when I invoke the command as follows:

$ svn2git http://apt-cyg.googlecode.com/svn/trunk  --verbose

Truly, I don't believe a very much simpler svn project can be found to convert; no branches, no tags, no nothing, only a trunk.

@hroncok
Copy link

hroncok commented Nov 8, 2012

Got the exact problem

@nirvdrum
Copy link
Owner

nirvdrum commented Nov 8, 2012

Did you try the using the --nobranches & --notags options?

@hroncok
Copy link

hroncok commented Nov 8, 2012

Yes,

svn2git https://wibom.svn.sourceforge.net/svnroot/wibom --nobranches --notags --authors ../authors.txt --verbose
Running command: git svn init --prefix=svn/ --no-metadata --trunk=trunk https://wibom.svn.sourceforge.net/svnroot/wibom
Initialized empty Git repository in /home/churchyard/tmp/wibom/.git/
Running command: git config --local svn.authorsfile ../authors.txt
Running command: git svn fetch 
W: Ignoring error from SVN, path probably does not exist: (160013): Filesystem has no item: File not found: revision 66, path '/trunk'
W: Do not be alarmed at the above message git-svn is just searching aggressively for old history.
This may take a while on large repositories
Checked through r66
Running command: git branch -l --no-color
Running command: git branch -r --no-color
Running command: git config --local --get user.name
Running command: git config --local --get user.email
Running command: git checkout -f master
error: pathspec 'master' did not match any file(s) known to git.
command failed:
2>&1 git checkout -f master

@nirvdrum
Copy link
Owner

nirvdrum commented Nov 8, 2012

It looks like you have a broken SVN repo. You may have to specify the starting revision greater than 66.

@hroncok
Copy link

hroncok commented Nov 9, 2012

I've just managed to svn commit in the old repo, it doesn't seem to be broken. Now I have revision 67 and the very same error.

Looking at http://wibom.svn.sourceforge.net/ everything seems to be fine.

@nirvdrum
Copy link
Owner

nirvdrum commented Nov 9, 2012

Unfortunately that doesn't mean the repo isn't broken. E.g., the Selenium SVN repo is actively developed against but its history was in some really funky state that made it impossible to convert to git. I can't really speak to whether your repo is corrupted or not. The error message just indicates there might be something awry.

@moreaki
Copy link
Author

moreaki commented Nov 9, 2012

Well, all the SVN repositories I had tried failed to convert using svn2git, so I moved on to yet another solution, which is http://svn2github.com/. This one not only does the work for you and creates a git tree on github, it actually works.

So for me currently the solution to convert other "Open Source" projects that seem to be abandoned to git to subsequently work on them is using http://svn2github.com/. I'll happily give svn2git another spin if it's shown to work with my simple example above.

@nirvdrum
Copy link
Owner

nirvdrum commented Nov 9, 2012

@moreaki Well, the reason I asked if you tried the --notags and --nobranches option is because you indicated in your initial post that your repo doesn't have tags or branches, but the command you ran didn't match that statement.

Beyond that, I ran your command and it worked just fine for me. I have git 1.7.9.5 installed. Note that svn2git is just a wrapper around git-svn. So, if the repo can't be processed for you with git-svn, it'll never work with svn2git.

@yktoo
Copy link

yktoo commented Nov 16, 2012

I had exactly same issue, it turned out the cause was that I had a "non-standard repository layout", ie. no trunk/, branches/ or tags/ directories at the top.

All I needed to do is add --rootistrunk to the svn2git command.

@nirvdrum
Copy link
Owner

Closing for now since I was able to convert the repo in question without any problems. Please re-open if you find otherwise.

@jpbonn
Copy link

jpbonn commented Aug 21, 2013

I got around this by removing the .git directory from the working directory. It was created during previous failed attempts at running svn2git. I also needed --rootistrunk.

@mitchsw
Copy link

mitchsw commented Jan 25, 2014

jpbonn's comment above helped me.

@jimbethancourt
Copy link

The --rootistrunk flag fixed this for me in some circumstances. Thanks @yktoo!

@ktalik
Copy link

ktalik commented Nov 4, 2014

As proposed in #144 by @ludwigschwardt --trunk / helped me.

FYI: I had the topic error on default options:

$ svn2git https://kajko.ii.uj.edu.pl/svn/robotics/ --username talik
command failed:
git checkout -f master

Then, tried with --rootistrunk:
(of course without previous .git directory)

$ svn2git https://kajko.ii.uj.edu.pl/svn/robotics/ --username talik --rootistrunk
Initialized empty Git repository in /home/konrad/workspace/robotics/smieci/.git/
E: 'https:/kajko.ii.uj.edu.pl/svn/robotics' is not a complete URL  and a separate URL is not specified
command failed:
git svn init --prefix=svn/ --username=talik --no-metadata --trunk=https://kajko.ii.uj.edu.pl/svn/robotics/

And so it turned into "xxx is not a complete URL" issue.

Cheers.

@nirvdrum
Copy link
Owner

nirvdrum commented Nov 4, 2014

Thanks for the feedback. Unfortunately, I have no control over what git-svn provides for error messages. The best I can do is pass them back. Running with the --verbose flag may yield more output for you.

@vmichnowicz
Copy link

Your suggestion worked, thank you @yktoo

@benson-basis
Copy link

I am hitting this with a standard repo layout:

Running command: git svn init --prefix=svn/ --no-metadata --trunk=trunk --tags=tags --branches=branches http://svn.basistech.net/engineering/web-services-common
Initialized empty Git repository in /Users/benson/x/web-services-common/.git/
Using higher level of URL: http://svn.basistech.net/engineering/web-services-common => http://svn.basistech.net/engineering
Running command: git config --local --get user.name
Running command: git config --local svn.authorsfile ~/.svn2git/authors
Running command: git svn fetch
W: Ignoring error from SVN, path probably does not exist: (160013): Filesystem has no item: File not found: revision 100, path '/web-services-common'
W: Do not be alarmed at the above message git-svn is just searching aggressively for old history.
This may take a while on large repositories
Running command: git branch -l --no-color
Running command: git branch -r --no-color
Running command: git config --local --get user.name
Running command: git config --local --get user.email
Running command: git checkout -f master
error: pathspec 'master' did not match any file(s) known to git.
command failed:
git checkout -f master

@nirvdrum
Copy link
Owner

@benson-basis What does your repository look like at that point? It looks like git-svn had some difficulty with the repo at some point in the process.

@benson-basis
Copy link

I'm really sorry, that was entirely pilot error and a mis-spelled URL that I missed 4 times. I was just about to delete my comment before you got to it.

@OscarAkaElvis
Copy link

Hi guys, instead of use --rootistrunk which creates to me a "xxx is not a complete URL" issue like @ktalik said... I used --notrunk and worked like a charm.

@migounette
Copy link

Try to delete the remaining .git (ls -al) and restart.
It works for me.

@x9t9
Copy link

x9t9 commented Dec 27, 2016

For me , ( simple , standard tortoise repos ) , after trying all the options, only @OscarAkaElvis 's solution worked . So thanks.. :-)

@jamessr2
Copy link

Same boat as x9t9 (also a tortoise repo), notrunk is the only thing that worked

@standingdreams
Copy link

standingdreams commented Sep 10, 2017

@jpbonn's solution to remove the .git directory and add --rootistrunk worked for me.

@paulschreiber
Copy link

Running rm -rf .git and adding --rootistrunk worked for me.

@penam
Copy link

penam commented May 7, 2019

running rm -rf .git and adding --rootistrunk worked for me too. thanks

@SergioGomez321
Copy link

running rm -r .git worked for me thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests