Skip to content

Commit edefca4

Browse files
authored
Remove references to master and replace with main
1 parent 16d914a commit edefca4

1 file changed

Lines changed: 11 additions & 7 deletions

File tree

_learn/00-github-for-docs-files.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ The terms sound confusing at first. Here's a list of vocabulary words to help yo
5757

5858
| Term | Definition |
5959
|--------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
60-
| branch | A parallel version of a repo within the repo that does not affect the primary or master branch. You can work freely in a branch without affecting the live version. After you make changes, you can merge your branch into the master branch to publish your changes. |
60+
| branch | A parallel version of a repo within the repo that does not affect the primary or main branch. You can work freely in a branch without affecting the live version. After you make changes, you can merge your branch into the main branch to publish your changes. |
6161
| clone | A copy of a repo that lives on your computer instead of on a website's server. |
6262
| commit | A point-in-time snapshot of a repo. Commits let you see the differences between changes. A commit is an individual change to a file or set of files. Every time that you save a file or a set of files, Git creates a unique ID, also known as the SHA or hash, that tracks the changes. Commits usually contain a commit message, which is a brief description of what changes were made. |
6363
| downstream | A label for a remote URL, where a remote represents a place where code is stored. A downstream remote indicates an opposite of an upstream, or original, repo. |
@@ -75,9 +75,9 @@ The terms sound confusing at first. Here's a list of vocabulary words to help yo
7575

7676
You want to get a good sense of these terms, because when you're new to Git, it's easy to confuse named directories, such as a cloned fork that is named after the original repo, and Git branches.
7777

78-
You can instruct Git to base your branch on the `master` branch in `upstream`, `origin`, or another `named` remote. For example, this command bases a new branch on the `master` branch in the `upstream` remote:
78+
You can instruct Git to base your branch on the `main` branch in `upstream`, `origin`, or another `named` remote. For example, this command bases a new branch on the `main` branch in the `upstream` remote:
7979
```
80-
$ git checkout upstream/master -b my-branch
80+
$ git checkout upstream/main -b my-branch
8181
```
8282

8383
## Set up prompts (Terminal on MacOS or Linux)
@@ -171,7 +171,7 @@ If you get a 404 page after logging in, then you need to be added as a collabora
171171
Output:
172172

173173
```
174-
* master
174+
* main
175175
```
176176

177177
Now you have a local copy of the content and can do more steps in [Working with content in GitHub repositories](https://docslikecode.com/learn/04-add-content-workflow/). Hopefully you have a good starting point for working with docs repositories.
@@ -186,7 +186,11 @@ Before you get too far writing content for a new site, get the directory set up
186186
```
187187
$ echo "# do-docs-as-code" >> README
188188
```
189-
1. In the root directory, initialize the Git repo.
189+
1. Set up your local Git installation so that it uses `main` for the default branch name every time you use the `git init` command.
190+
```bash
191+
git config --global init.defaultBranch main
192+
```
193+
4. In the root directory, initialize the Git repo.
190194
```bash
191195
$ git init
192196
```
@@ -204,9 +208,9 @@ $ echo "# do-docs-as-code" >> README
204208
```bash
205209
$ git remote add origin <paste the reference>
206210
```
207-
1. In the Terminal window, set the newly added remote as the upstream branch and push the initial commit to this new remote named origin.
211+
1. In the Terminal window, set the newly added remote as the upstream "tracker" (named origin) and push the initial commit to this new branch named `main`.
208212
```
209-
$ git push --set-upstream origin master
213+
$ git push --set-upstream origin main
210214
```
211215

212216
## Ignoring operating system files or generated files

0 commit comments

Comments
 (0)