0

I created a new branch called table in Git, but I didn't run git fetch origin before creating it.

It turns out someone created a branch called table before I did.

How can I delete the one I created and checkout theirs?

Cœur
  • 37,241
  • 25
  • 195
  • 267
CharliePrynn
  • 3,034
  • 5
  • 40
  • 68
  • See [git checkout remote branch](http://stackoverflow.com/questions/1783405/git-checkout-remote-branch/1783426#1783426) and [Git Branching](http://git-scm.com/book/en/Git-Branching). –  Aug 08 '13 at 17:07

2 Answers2

1

Do the following:

$ git branch -D table
$ git checkout -b table origin/table
0

The -m flag will allow you to rename a branch.

git branch -m oldname newname
Ben Campbell
  • 4,298
  • 2
  • 29
  • 33