简体   繁体   中英

GitHub: 'master' not visible in List of branches

I am very new to Git.

  • I created a new repository - Tutorial
  • Under that I created two branches - demo-branch and tutorial-branch , one by one, and did some changed and pushed
  • I checked in GitBash, that I have three branches - master and above two

在此处输入图片说明

However, when I visit GitHub online in browser, it shows me only two branches在此处输入图片说明

在此处输入图片说明

Why is master branch not shown ? Am I conceptually missing something ?

If you didn't push master to GitHub, you can't see master branch on GitHub.

I assumed you created Tutorial repo from bash, not from GitHub. master branch is automatically created by Git on a new repository but not pushed. To get the branch on GitHub do git push origin master:master .

This command push onto origin git repository the local branch master to remote branch master and create it if needed.

  • origin is the default name of remote repository. In your case this is your GitHub repository.
  • Local master branch is your ... local master branch
  • Remote branch master is the branch on origin remote, so GitHub. This one is updated when user push onto master branch

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM