threads / discuss / 13386

git checkout -b -f v1.5.5.1

Subject: git checkout -b -f v1.5.5.1

## tl;dr

4 messages between May 5, 2008 and May 5, 2008.

replies: 3people: 3as markdown or json

Jun Ma· May 5, 2008, 15:48 UTC · lore
Hi, all
     I just mistaken 'git checkout -b 1.5.5.1 v1.5.5.1' to 'git
checkout -b -f v1.5.5.1', and I don't how to delete it ,
  537  git-branch -D -f
  538  git-branch -D \-f
  539  git-branch -D "\-f"
     all the above operations were failed. :(
     PS: Would it be better if we do checking on branch name to avoid
this case?
-- 
FIXME if it is wrong.
Stephan Beyer· May 5, 2008, 15:58 UTC · re: Jun Ma · lore

Re: git checkout -b -f v1.5.5.1

Hi,
>      I just mistaken 'git checkout -b 1.5.5.1 v1.5.5.1' to 'git
> checkout -b -f v1.5.5.1', and I don't how to delete it ,
Try
  git branch -D -- -f
Show 5 quoted lines
>   537  git-branch -D -f
>   538  git-branch -D \-f
>   539  git-branch -D "\-f"
> 
>      all the above operations were failed. :(

In all cases, git-branch gets -f as parameter, because your shell "expands" them to -f.

> PS: Would it be better if we do checking on branch name to avoid this case?

What do you want to check for? No leading dashes?

-- 
Stephan Beyer <s-beyer@gmx.net>, PGP 0x6EDDD207FCC5040F
Jun Ma· May 5, 2008, 16:09 UTC · re: Stephan Beyer · lore

Re: git checkout -b -f v1.5.5.1

On Mon, May 5, 2008 at 11:58 PM, Stephan Beyer <s-beyer@gmx.net> wrote:
Show 6 quoted lines
>  >      I just mistaken 'git checkout -b 1.5.5.1 v1.5.5.1' to 'git
>  > checkout -b -f v1.5.5.1', and I don't how to delete it ,
>
>  Try
>   git branch -D -- -f
>
It works, thanks. :)
Show 6 quoted lines
>
>  > PS: Would it be better if we do checking on branch name to avoid this case?
>
>  What do you want to check for?
>  No leading dashes?
>

I thought it would be better do this job, so we won't get a malformed(I thought '-f' is) branch name.:)

-- 
FIXME if it is wrong.
Eric Hanchrow· May 5, 2008, 16:03 UTC · re: Jun Ma · lore

Re: git checkout -b -f v1.5.5.1

    Hi, all
         I just mistaken 'git checkout -b 1.5.5.1 v1.5.5.1' to 'git
    checkout -b -f v1.5.5.1', and I don't how to delete it ,
      537  git-branch -D -f
      538  git-branch -D \-f
      539  git-branch -D "\-f"
         all the above operations were failed. :(
         PS: Would it be better if we do checking on branch name to avoid
    this case?
You could probably just
    rm .git/refs/heads/-f
and if necessary, replace the content of .git/HEAD with something else.
-- 
FIXME if it is wrong.

-- 

                               _
                              / )
              (\__/)         ( (
              )    (          ) )
            ={      }=       / /
              )     `-------/ /
             (               /
              \             )
             ,'\       ,    ,'
             `-'\  ,---\   | \
                _) )    `. \ /
               (__/       ) )   hjw
                         (_/

← back to recent threads