A randomly created branch named origin / master

In a fit of incredible stupidity, I accidentally ran

git checkout -b origin / master

And now you have a branch named origin / master that destroys everything. Is it safe to just run

git -D origin / master?

I tried to look in the config for the branch, but it is not defined there. However, when I run the git branch, I see it.

):

+6
source share
1 answer

git branch -D origin/master will remove the local branch origin/master .

This will not delete the origin (remote) master branch. Deleting deleted branches will either:

(git 1.7.0)

git push origin --delete branch

or

git push origin :branch

+8
source

Source: https://habr.com/ru/post/909325/


All Articles