In a fit of unbelievable stupidity I accidentally ran
git checkout -b origin/master
And now have a branch named origin/master which ruins everything. Is it safe to just run
git -D origin/master?
I tried looking in the config for the branch but its not defined there. Yet when I run git branch I see it.
):
Can the master branch be deleted? The master branch is just a type of branch in the repository, which is also the default branch by default. But, as a rule in Git, default branches cannot be deleted. So, to delete the master branch first, the user has to change the default branch.
git branch -D origin/master
will delete your local origin/master
branch.
This will not delete your origin
's (remote) master
branch. Deleting your remote branches would be either:
(git 1.7.0)
git push origin --delete branch
or
git push origin :branch
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With