开发者

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

开发者 https://www.devze.com 2022-12-29 01:34 出处:网络
I mistyped a git command which resulted in the creation of a local branch called, \'--track\'. I\'ve tried the following:

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

精彩评论

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