Hello, all. I am new to Github and have been carefully following several tutorials in order to create my first repository that results in nothing but failure and confusion.
When I create a repository, I see that the only branch is labeled as “main”. However, in Git bash, I never see main, my directory is instead labeled “(master)”. However, I assume this is some hangover from this new PC change, so I decided to do everything by referring to the ‘main’ branch, which I have read is no different from the master and is the societally approved way of referring to the most important branch going forward.
I do all my pull/commit commands with main, i.e. git pull origin main and it seems to work. However, in the stage of pushing (git push origin main), I get this error: error: src refspec main does not match any
error: failed to push some refs to ‘BLAH · GitHub blah blah.git’
I have read over and over again that this is because I didn’t commit properly. However, I commit again and it says: On branch master nothing to commit, working tree clean (so, again, it refers to a master branch that doesn’t exist).
So, I changed my push to “git push origin master” and now it adds a master branch to my repository and adds all the project files as expected to that branch. But, now my repository is clearly racist, which implicates me and my products as racist as well.
My question is what in the heck is going on? What is the difference between main and master? Why can I not commit to main but can create a master branch and commit to that? Why does Git Bash refer to my main branch as a master branch? If I create a master branch, is the main branch still the master one?