react-gh-pages icon indicating copy to clipboard operation
react-gh-pages copied to clipboard

Update README.md - Use branch name "main" instead of "master"

Open Souravdey777 opened this issue 4 years ago • 1 comments

Souravdey777 avatar Dec 24 '20 12:12 Souravdey777

Hi @Souravdey777 , thanks for submitting this.

I overhauled the instructions today . One of the changes I initially made was to use the branch name of main instead of master. However, I ran into an issue because, on my system, create-react-app still created a branch named master (not main), which led to Git complaining when I tried to push the app's source code up to origin/main via $ git push origin main.

Once I ran into that issue, I considered adding instructions on renaming the master branch to main. However, I came across some statements online claiming that create-react-app uses whatever branch name is set in some Git configuration parameter, whether that name be main, master, or something else (i.e. there is a chance that someone's branch might be named something other than master or main, even after they've followed all the existing instructions).

At this point, rather than dealing with Git configuration files, my plan is to add an instruction similar to the one I just described, but which only addresses what I think is the most common situation (other than having a local branch named main already): "If your local branch is named master and you want it to be named main instead, you can run $ git branch -m master main. Then, to push your local main branch to GitHub, you can run $ git push origin main."

That way, I don't have to account for, nor put energy into learning, the factors that influence the branch name used by create-react-app when it generates the local Git repo.

Thanks again for submitting this PR. In an upcoming update, I will be adding a list of contributors to the bottom of the README. Are you OK with me including you in that list?

gitname avatar Jan 20 '22 05:01 gitname

Fixed (in a different way) via https://github.com/gitname/react-gh-pages/pull/130

Copy/pasting question from previous comment:

Thanks again for submitting this PR. In an upcoming update, I will be adding a list of contributors to the bottom of the README. Are you OK with me including you in that list?

(Update: The list of contributors exists in the README now.)

gitname avatar Jan 18 '23 18:01 gitname