error: pathspec 'master' did not match any file(s) known to git. #41

Open
ensonic opened this Issue Jan 2, 2012 · 10 comments

Comments

Projects
None yet
9 participants
@ensonic

ensonic commented Jan 2, 2012

Instead of hijacking ticket #23, I'll try as a new one as it might be a different issue. See the log below:

  • svn2git-2.1.2 (a --version option would be nice)
  • the author file is okay, but same error happens without --authors
  • it does not matter wheter I use --username or not
  • it does not matter wheter I use --nobranches or not (but I don't want to preserve the branches anyway)
  • same error happens if I convert the whole repo (giving trunk instead of trunk/bml) or another subproject (in the same repo)

I am getting a bit desperate and wonder what else I could try to shed light on this issue. Should't "git branch -l" show something already. Maybe you could add some sanity checks after each step and error out earlier. I have the feeling that the error in the description just means "sonmething failed along the way" :/

The only result is a single 24bytes small file (among the usual git infrastructure)
.git/svn/refs/remotes/svn/trunk/.rev_map.489a8a1a-d840-0410-b443-d4df6bd36c0d

svn2git https://buzztard.svn.sourceforge.net/svnroot/buzztard/trunk/bml --username ensonic --authors ../authors.txt --verbose --nobranches
Running command: git svn init --prefix=svn/ --username=ensonic --no-metadata --trunk=trunk --tags=tags https://buzztard.svn.sourceforge.net/svnroot/buzztard/trunk/bml
Initialized empty Git repository in /home/ensonic/projects/buzztard/git/bml/.git/
Using higher level of URL: https://buzztard.svn.sourceforge.net/svnroot/buzztard/trunk/bml => https://buzztard.svn.sourceforge.net/svnroot/buzztard
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 100, path '/trunk/bml'
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 r100
Running command: git branch -l --no-color
Running command: git branch -r --no-color
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

@ensonic

This comment has been minimized.

Show comment
Hide comment
@ensonic

ensonic Jan 2, 2012

Okay, it seem that one needs to convert the whole repository and then use git filter-branch remove subprojects. That is if one has:
trunk/
project1/
project2/

one cannot run svn2git using http://server.com/trunk/project1, but instead need to run it using http://server.com for each project and then filter:
git filter-branch --subdirectory-filter --tag-name-filter cat -- --all

Now I still need to figure how to fixup the messed up tags.

ensonic commented Jan 2, 2012

Okay, it seem that one needs to convert the whole repository and then use git filter-branch remove subprojects. That is if one has:
trunk/
project1/
project2/

one cannot run svn2git using http://server.com/trunk/project1, but instead need to run it using http://server.com for each project and then filter:
git filter-branch --subdirectory-filter --tag-name-filter cat -- --all

Now I still need to figure how to fixup the messed up tags.

@andrewfhart

This comment has been minimized.

Show comment
Hide comment
@andrewfhart

andrewfhart Jan 22, 2012

Hey @ensonic, I was getting the same error you reported. Here's what I did to get just what I wanted out of svn2git for a single nested subproject:

To export project 'x' in a repo at http://example.org/svn, where 'x' is a nested project with structure ./x/trunk ./x/branches and ./x/tags, and where the first revision in which 'x' appears in the repository is r153, I did:

svn2git http://example.org/svn --verbose --revision 153 --trunk x/trunk --branches x/branches --tags x/tags

and it seems to have figured everything out nicely for project 'x'. Basically, I just pushed the project name (x) onto the --trunk, --branches, and --tags paths and it worked out alright.

Thanks for your comment on this issue, it got me started on the right train of thought!

Hey @ensonic, I was getting the same error you reported. Here's what I did to get just what I wanted out of svn2git for a single nested subproject:

To export project 'x' in a repo at http://example.org/svn, where 'x' is a nested project with structure ./x/trunk ./x/branches and ./x/tags, and where the first revision in which 'x' appears in the repository is r153, I did:

svn2git http://example.org/svn --verbose --revision 153 --trunk x/trunk --branches x/branches --tags x/tags

and it seems to have figured everything out nicely for project 'x'. Basically, I just pushed the project name (x) onto the --trunk, --branches, and --tags paths and it worked out alright.

Thanks for your comment on this issue, it got me started on the right train of thought!

@technicalreality

This comment has been minimized.

Show comment
Hide comment
@technicalreality

technicalreality Jul 20, 2012

In my case I got the error above due to an issue somewhere in the .git directory. I deleted the .git directory and re-ran svn2git and things started working.

In my case I got the error above due to an issue somewhere in the .git directory. I deleted the .git directory and re-ran svn2git and things started working.

@lvnilesh

This comment has been minimized.

Show comment
Hide comment
@lvnilesh

lvnilesh Aug 19, 2012

svn2git http://svn.quantsoftware.org/openquantsoftware/trunk --verbose Running command: git svn init --prefix=svn/ --no-metadata --trunk=trunk --tags=tags --branches=branches http://svn.quantsoftware.org/openquantsoftware/trunk Initialized empty Git repository in /Users/nilesh/projects/test/.git/ Using higher level of URL: http://svn.quantsoftware.org/openquantsoftware/trunk => http://svn.quantsoftware.org/openquantsoftware 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

svn2git http://svn.quantsoftware.org/openquantsoftware/trunk --verbose Running command: git svn init --prefix=svn/ --no-metadata --trunk=trunk --tags=tags --branches=branches http://svn.quantsoftware.org/openquantsoftware/trunk Initialized empty Git repository in /Users/nilesh/projects/test/.git/ Using higher level of URL: http://svn.quantsoftware.org/openquantsoftware/trunk => http://svn.quantsoftware.org/openquantsoftware 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

@zakkak

This comment has been minimized.

Show comment
Hide comment
@zakkak

zakkak Jan 22, 2013

I second @technicalreality. Removing .git fixed my problem.

zakkak commented Jan 22, 2013

I second @technicalreality. Removing .git fixed my problem.

@tforster

This comment has been minimized.

Show comment
Hide comment
@tforster

tforster Jan 22, 2013

I'm getting the same issue. I've removed the .git folder but still the same error message. Any other thoughts?

I'm getting the same issue. I've removed the .git folder but still the same error message. Any other thoughts?

@tforster

This comment has been minimized.

Show comment
Hide comment
@tforster

tforster Jan 22, 2013

FYI, it is with one of our original projects in SVN from quite a while ago. I see that the containing folder immediately below trunk was renamed. Originally www it is now webcontent. Could the renaming be affecting it?

FYI, it is with one of our original projects in SVN from quite a while ago. I see that the containing folder immediately below trunk was renamed. Originally www it is now webcontent. Could the renaming be affecting it?

@madrugado

This comment has been minimized.

Show comment
Hide comment
@madrugado

madrugado Feb 1, 2013

Thanks for the tip, @technicalreality. It's work for me like a charm.

Also I've an issue with svn2git similar to @tforster 's one. In my case the clue was to understand that trunk folder has the name of the project itself, so the option "--rootistrunk" was my choice. Hope this'll help.

Thanks for the tip, @technicalreality. It's work for me like a charm.

Also I've an issue with svn2git similar to @tforster 's one. In my case the clue was to understand that trunk folder has the name of the project itself, so the option "--rootistrunk" was my choice. Hope this'll help.

@abhinavsingh

This comment has been minimized.

Show comment
Hide comment
@abhinavsingh

abhinavsingh Jul 5, 2013

@technicalreality Thanks for that tip. Deleted .git folder and re-run svn2git, all is good now. Though I wonder why this tip works.

@technicalreality Thanks for that tip. Deleted .git folder and re-run svn2git, all is good now. Though I wonder why this tip works.

@drmjc

This comment has been minimized.

Show comment
Hide comment
@drmjc

drmjc Aug 28, 2013

thanks to @andrewfhart and @technicalreality and @btjones from #59)

I wanted to convert a heavily nested SVN repo to individual git repo's. eg https://server.com/svn/inteomics/Mark/R/excelIO/ where each project had to traditional structure: {trunk,branches,tags}

I needed to do 3 things:

  1. use a fresh folder -- ie no .git
  2. enable -v and enter my password every time the 'Authentication realm: https://server:443 Subversion Repositories' message popped up (>5 times).
  3. explicitly specify --trunk, --branches and --tags as below:

svn2git https://server.com/svn/inteomics --username marcow -v --trunk Mark/R/excelIO/trunk --branches Mark/R/excelIO/branches --tags Mark/R/excelIO/tags

drmjc commented Aug 28, 2013

thanks to @andrewfhart and @technicalreality and @btjones from #59)

I wanted to convert a heavily nested SVN repo to individual git repo's. eg https://server.com/svn/inteomics/Mark/R/excelIO/ where each project had to traditional structure: {trunk,branches,tags}

I needed to do 3 things:

  1. use a fresh folder -- ie no .git
  2. enable -v and enter my password every time the 'Authentication realm: https://server:443 Subversion Repositories' message popped up (>5 times).
  3. explicitly specify --trunk, --branches and --tags as below:

svn2git https://server.com/svn/inteomics --username marcow -v --trunk Mark/R/excelIO/trunk --branches Mark/R/excelIO/branches --tags Mark/R/excelIO/tags

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment