Join the Stack Overflow Community
Stack Overflow is a community of 6.4 million programmers, just like you, helping each other.
Join them; it only takes a minute:
Sign up

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.

share|improve this question

marked as duplicate by Alex Wayne, Jean, evilone, Kris, slugster Oct 16 '12 at 8:36

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
can you do git remote ? maybe your remote is not origin ... – Jean Oct 8 '12 at 19:16
    
Seems is not, but which one is my repo? I posted the results below. – Cristi Băluță Oct 8 '12 at 19:36

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.

share|improve this answer

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>
share|improve this answer

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)

share|improve this answer
    
ls-remote gives me this. Balutas-MacBook-Pro:sdk.ralcr Cristi$ git ls-remote From git@github.com:ralcr/sdk.ralcr.git 75e1db961aa1d2377e6f7c35542d7ee3a53712a0 HEAD 75e1db961aa1d2377e6f7c35542d7ee3a53712a0 refs/heads/gh-pages 8edf43d1bb60646c5c2f2026bae8c229763d5f98 refs/heads/master – Cristi Băluță Oct 8 '12 at 19:32
    
Oh sorry, it's just git remote. ls-remote is to list remote branches, tags, and other refs. (edited) – Simon Boudrias Oct 8 '12 at 19:35
    
Ok, git remote gives me something else: ralcr – Cristi Băluță Oct 8 '12 at 19:40
    
But still not working: Balutas-MacBook-Pro:sdk.ralcr Cristi$ git push ralcr :gh-pages remote: error: refusing to delete the current branch: refs/heads/gh-pages To git@github.com:ralcr/sdk.ralcr.git ! [remote rejected] gh-pages (deletion of the current branch prohibited) error: failed to push some refs to 'git@github.com:ralcr/sdk.ralcr.git' – Cristi Băluță Oct 8 '12 at 19:41
    
Oh, you should check out you use a writable url/protocol on your remote if .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? – Simon Boudrias Oct 8 '12 at 19:50

Not the answer you're looking for? Browse other questions tagged or ask your own question.