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.
-
can you do git remote ? maybe your remote is not origin ...Jean– Jean2012年10月08日 19:16:10 +00:00Commented Oct 8, 2012 at 19:16
-
Seems is not, but which one is my repo? I posted the results below.Cristi Băluță– Cristi Băluță2012年10月08日 19:36:57 +00:00Commented Oct 8, 2012 at 19:36
3 Answers 3
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.
Comments
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)
6 Comments
git remote. ls-remote is to list remote branches, tags, and other refs. (edited).git/config (git:// protocol is read only). If this is good, then you should checkout you really have write access to your repo. Is it your own?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>