Delete a github branch
Possible Duplicate:
How do I delete a Git branch both locally and in Github?
First of all, I read how to remove a branch, but for some reason is not working on my project: https://github.com/ralcr/sdk.ralcr
When you first enter here you see some files 10 months old in a gh-pages branch. I have no idea how this branch was created and why it's displayed first, but I want to remove it and this is not working
Balutas-MacBook-Pro:sdk.ralcr Cristi$ git push origin --delete gh-pages
fatal: 'origin' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
I want only the master branch.
I found the solution here: https://github.com/matthew-brett/pydagogue/blob/master/gh_delete_master.rst I couldn't delete the branch because was the default branch. To change it go to Admin and there's a drop down for that.
Try using git branch -d <feature-branch>
, it should let you delete a feature branch.
(though normally git merge <branch-name>
is called before that to merge the branch before deleting it)
To delete the branch on remote:
git push origin :<feature-branch>
To delete a remote branch, you must do it like so:
git push <remote> :<branch>
# example
git push origin :gh-pages
But in your case, origin don't seem to be a remote repo. You should checkout your remote name and use the good one.
git remote
Also, make sure your remote URL is writable one. Using the git
protocol is read only, and so you'll need to pickup the ssh
one. (should also work with the https
url)
上一篇: 如何删除“origin / origin / master”
下一篇: 删除一个github分支