skills / introduction-to-github

Get started using GitHub in less than an hour.
MIT License
4.37k stars 1.9k forks source link

[Bug]Cannot create 'my-first-branch' #222

Closed damo-maker closed 1 year ago

damo-maker commented 1 year ago

Describe the bug There is no Create branch button in the main drop down box

To Reproduce Steps to reproduce the behavior:

  1. Go to Code tab
  2. Click on 'main'
  3. enter 'my-first-branch' in the main drop down
  4. With 'branches' selected can only see 'Nothing to show'

Expected behavior I expected to see and be able click on 'Create branch:my-first-branch from main'

Screenshots

Screenshot 2023-01-13 at 15 31 29

Device information I am on a Mac M1 running Ventura OS

ranadip01in commented 1 year ago

I think the bug is solved. That bug is not occured in my windows machine. You should try again.

borisUOP commented 1 year ago

Hi, I think the bug still persists.

skroger30 commented 1 year ago

I think the bug still persists. I cannot see the option to create my-first-branch.

andrewgreen76 commented 1 year ago

My solution: I just used ChatGPT to help me nail this sucker via the Bash terminal.

1) So first, you'll have to learn to use the Bash terminal (Ctrl + Alt + T) if you have a Unix-like. I don't have instructions for Windows users.

2) Then you have to clone your remote repo to make a local copy of it in your system (unless you already have one), ideally in your 'user home' directory. Feel free to 'git clone' it straight to your 'user home' directory; it will simply create a local repo directory in there instead of dumping the content itself. What I did is I typed the command 'git clone https://...' with the https://... url that I copied from the remote repo page's green Code button drop-down menu, ... and voila. (Sorry, I've never used GitHub with SSH or GitHub CLI.)

3) Basically, once inside the local repo in the Bash CLI, you type 'git branch my-first-branch' to finally create a new branch of the main branch. You don't have to 'checkout' to shift the local repo's "focus" on that branch quite yet.

4) Once you do that, feel free to type 'git branch', which should list all the branches that sprouted from your local repo. However, you've only made a change to your local repo.

5) Finally, for the added branch to reflect on the remote repo, definitely do this: push with 'git push --set-upstream origin my-first-branch'.

6) Once that's done, refresh the page of your remote repo and look up the branches there.

I understand it's quite an event, and hopefully they'll get the documentation squared away. Never stop trying!

(BTW, I'm using Ubuntu, in case if you are curious, but I don't think it really matters. I think it's an issue on the server side. Nothing about any client should change the remote repo's features/content.)

sinsukehlab commented 1 year ago

It seems that you were trying to create a new branch on the skills/introduction-to-github repository, to which you don't have write access. You should first generate your new repository and create a new branch on that repository.

Mokatoto commented 1 year ago

نعم

cmwilson21 commented 1 year ago

I'm going to go ahead and close this issue as it seems to have been solved 👍