Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

delete local branch called "remote"

I've done something incredibily stupid. I figured I should ask before I tried to "fix" it and accidentally make things worse.

I tried to list all remote branches in my git repo:

git branch remote

Obviously this isn't the correct command. Instead of listing remote branches, I created a local branch called remote. I should have done:

git branch -r

Can I just remove this branch with:

git branch -d remote

Will this have any effect on my remote branches? I don't want to accidentally delete anything on the remote side.

like image 686
tir38 Avatar asked Dec 21 '25 17:12

tir38


1 Answers

Yes,

git branch -d remote

Take a look:

MYHOST:git wwheeler$ cd seiso/
MYHOST:seiso wwheeler$ git branch
* master
  trunk
MYHOST:seiso wwheeler$ git branch remote
MYHOST:seiso wwheeler$ git branch
* master
  remote
  trunk
MYHOST:seiso wwheeler$ git branch -d remote
Deleted branch remote (was 15dc59f).
MYHOST:seiso wwheeler$ git branch
* master
  trunk
MYHOST:seiso wwheeler$