Skip to content

Commit

Permalink
[git] reflect branch rename from 'master' to 'main' (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
jwhui authored Mar 9, 2021
1 parent dbb5244 commit cacc268
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ For each new feature, create a working branch:

```bash
# Create a working branch for your new feature
git branch --track <branch-name> origin/master
git branch --track <branch-name> origin/main

# Checkout the branch
git checkout <branch-name>
Expand All @@ -75,24 +75,24 @@ This will open up a text editor where you can craft your commit message.

Prior to submitting your pull request, it's good practice to clean up your branch and make it as simple as possible for the original repo's maintainer to test, accept, and merge your work.

If any commits have been made to the upstream master branch, you should rebase your development branch so that merging it will be a simple fast-forward that won't require any conflict resolution work.
If any commits have been made to the upstream main branch, you should rebase your development branch so that merging it will be a simple fast-forward that won't require any conflict resolution work.

```bash
# Fetch upstream master and merge with your repo's master branch
git checkout master
git pull upstream master
# Fetch upstream main and merge with your repo's main branch
git checkout main
git pull upstream main

# If there were any new commits, rebase your development branch
git checkout <branch-name>
git rebase master
git rebase main
```

At this point, it might be useful to squash some of your smaller commits down into a small number of larger more cohesive commits. You can do this with an interactive rebase:

```bash
# Rebase all commits on your development branch
git checkout
git rebase -i master
git rebase -i main
```

This will open up a text editor where you can specify which commits to squash.
Expand Down

0 comments on commit cacc268

Please sign in to comment.