0

Im new to github and Im trying to push some files to my repository. But I have the 'main' branch with the README file but all my files are being pushed to the new 'master' branch added using GIT bash. So when somebody enters this repository it will just see the main branch with a README file, and all the project files will be at the master branch. Is there a problem with it? I hope I made myself clear. Also if you have any tips for this newbie user, they are all welcome. Thank you in advance!

1 Answers1

1

Github recently decided to rename all its main branches from master to main by default.
Git Bash still uses master as the default main branch. To simply fix the problem, you can rename your branch from master to main on Git Bash using the following command:

$ git branch -M main
(This command allows you to rename the current branch in which you are working)

So, after deleting the master branch on Github and applying the command suggested above, push your code again: you will now have only one main branch called main on both Github and Git Bash.

Giuseppe Amato
  • 103
  • 1
  • 1
  • 7