开发者

I accidentally created a git local branch called --track, how can I delete it?

I mistyped a git command which resulted in the creation of a local branch called, '--track'.

I've tried the following:

git branch -m --track delme
(this renames the current branch to delme, not the branch called --track)

git ch开发者_运维知识库eckout --track
> fatal: --track needs a branch name

git branch -d --track
(does nothing, reports nothing)

git branch -D --track
(also does nothing)

git branch -d "--track"
(also does nothing

How can I delete this branch?


git branch -d -- --track

In general, -- tells git to treat all subsequent command-line arguments as non-options.

EDIT: See the comments for clarification regarding how git uses --.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜