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
  • 34,719
  • 24
  • 185
  • 251
CharliePrynn
  • 2,924
  • 5
  • 37
  • 66
  • 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
  • 3,898
  • 1
  • 27
  • 33