Re: "git checkout foo" is getting confused by folder named "foo"
- From
David Aguilar <davvid@gmail.com>
- Date
- Sep 25, 2013, 02:51 UTC
- Message-ID
- <CAJDDKr64ou+gO7WJLFZ4zOSv+VCbkiW7nKuZa9=5_fiSqGUeyQ@mail.gmail.com>
- In-Reply-To
- <CAEQewpqLcDJPo2gUWPk-xc3OitdTC4gH2tnyqaURiQ77BApNog@mail.gmail.com>
On Tue, Sep 24, 2013 at 2:07 PM, Jona Christopher Sahnwaldt <jc@sahnwaldt.de> wrote:
Show 11 quoted lines
> Hi, > > maybe this has already been reported, but I didn't find it in the mail archive. > > If I understand correctly, after I clone a repo, I should be able to > switch to branch foo just by running > > git checkout foo > > This doesn't seem to work if a folder called "foo" exists in the root > of the repo.
git checkout foo --
The double-dash at the end disambiguates between refs and paths.
You can use that trick on any command that accepts refspec (branches, tags, etc) and pathspec (path patterns).
-- David