Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Having trouble with git filter-branch, "ambiguous argument"

Tags:

git

I have a git tree:

  • egit/
    • project1/
    • project2/

And I am trying to split project1 off to another repository. So I open command-prompt and cd into the egit folder. Then, following this tutorial, I run the command git filter-branch --prune-empty --subdirectory-filter \ project1\ master. I keep getting the error:

fatal: ambiguous argument 'project1\': unknown revision or path not in the
working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

I have verified that project1 is in my git repo using git ls-tree --full-tree -r HEAD, so I have no idea what is wrong. Any ideas?

like image 413
woojoo666 Avatar asked Nov 10 '22 00:11

woojoo666


1 Answers

Use the following command.

git filter-branch --prune-empty --subdirectory-filter project1 master

like image 116
Amit Dhara Avatar answered Nov 15 '22 04:11

Amit Dhara