문제

I was trying to track a remote branch with $ git checkout -b --track global/master, and git created a branch named "--track". Now, when I run $ git branch -D --track it won't delete the branch. I believe Git is parsing the last argument, --track, as a git-branch subcommand flag, not a branch name.

I attempted to quote the branch name with $ git branch -D '--track' and escape the leading hyphen with $ git branch -D \--track.

How can I delete the "--track" branch?

도움이 되었습니까?

해결책

As Uli Köhler already said:

git branch -D -- --track

The command will work to delete your branch.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top