#πŸ”’ Branches in VSCode (git)

24 messages Β· Page 1 of 1 (latest)

spark schooner
#

I'm doing all my steps using the controls in Source Control in VSCode. I've cloned the master branch of a forked repo. I have created a new branch. The next two steps do not automatically reflect online and I don't quite understand why: I have changed the name of my branch (I had to publish it and then manually delete the old branch on my github to only have the new branch, eventhough VSCode was only showing me the renamed branch). I have deleted the master branch, but I'm not sure how to now update github to show that it was deleted. Help pls?

hazy tinselBOT
#

@spark schooner

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

robust moon
spark schooner
#

on github I see

robust moon
#

can you show git branch also?

spark schooner
#
$ git branch
* non_local_means_update_#3285
robust moon
#
git branch -d master
git push --delete

I think this would cause your deletion of master in the local, cloned repo to propogate to the repo on github.

#

note that github might prevent you from deleting the master branch. this would be in the repo settings on github.

#

(that's a github feature, not a git feature.)

spark schooner
#
$ git branch -d master
error: branch 'master' not found.

$ git push --delete
fatal: --delete doesn't make sense without any refs
robust moon
#

(also I can't test these commands because I don't have any repos where I want to delete a branch on the remote πŸ˜› )

#

can you show git remote? you might need to do git push -d origin baster

spark schooner
#

this is a fork of an open source project, they just recommend deleting master so you don't accidentally work on it, but I suppose if it's gone in my VSCode, then I can't work on it anyway

#
$ git remote
origin
upstream
robust moon
#

yeah, so git push -d origin master

spark schooner
#

! [remote rejected] master (refusing to delete the current branch: refs/heads/master) I think we hit the github wall πŸ˜„

robust moon
#

indeed

spark schooner
#

that's fine, I was just wondering if I'm missing something obvious

#

thanks

robust moon
#

yw

spark schooner
#

!close

hazy tinselBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.