0

I have a remote branch on git which I want to delete (remotes/me/ntopng).

$ git branch -a
* master
  remotes/me/ntopng
  remotes/origin/gh-pages
  remotes/origin/go
  remotes/origin/master

But when trying to delete it getting this:

$ git push origin :remotes/me/ntopng
Username for 'https://github.com': Drewshg312
Password for 'https://[email protected]':
remote: Permission to Homebrew/homebrew.git denied to Drewshg312.
fatal: unable to access 'https://github.com/Homebrew/homebrew/': The requested URL returned error: 403

So I swithched to https://github.com/Drewshg312/homebrew.git doing:

git remote set-url origin https://github.com/Drewshg312/homebrew.git 

and got:

$ git push origin :ntopng
Username for 'https://github.com': Drewshg312
Password for 'https://[email protected]':
To https://github.com/Drewshg312/homebrew.git
 - [deleted]         ntopng

BUT the branch still there

$ git branch -a
* master
  pork
  scirius
  remotes/Drewshg312/hb_custom_formulas
  remotes/me/ntopng                <----- STILL THERE!! WTF???
  remotes/me/pork
  remotes/me/scirius
  remotes/origin/gh-pages
  remotes/origin/go
  remotes/origin/master

So how to delete it completely?

1 Answer 1

0

Is your origin url correct? Currently the original Homebrew/homebrew does not have a ntopng branch. You are probably not authorized to push to it, either.

If you are intended to push to your forked repo, the origin should be https://github.com/Drewshg312/homebrew.git


Edit for updated question:

As you see in the output

$ git branch -a
* master
  pork
  scirius
  remotes/Drewshg312/hb_custom_formulas
  remotes/me/ntopng          <----- this is another branch on a remote called 'me'
  remotes/me/pork
  remotes/me/scirius
  remotes/origin/gh-pages
  remotes/origin/go
  remotes/origin/master      <----- no ntopng in origin anymore

the remote branch on origin has been deleted. It seems you have multiple remote. Try git remote -v and see. To delete the branch in remote called me, just do what you did for origin

git push me :ntopng
4
  • You are right! but how can I change it to github.com/Drewshg312/homebrew.git to be able finally delete the branch?
    – drew1kun
    Aug 1, 2015 at 21:03
  • @Andrew git remote set-url origin https://github.com/Drewshg312/homebrew.git Aug 1, 2015 at 21:20
  • Check the post now - it's updated
    – drew1kun
    Aug 1, 2015 at 21:34
  • @Andrew see updates in the answer. Aug 1, 2015 at 22:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .