Skip to content

Commit

Permalink
contributing: Simplify branch instructions (#928)
Browse files Browse the repository at this point in the history
- First fetch, then switch to branch (branch is not available before the first fetch unless clone was from upstream).
- Use switch for switch to branch including its creation, not less readable checkout.
- git stash pop applies and removes, so just use that (no old stashes are accumulated).
- Mention GitHub CLI in PRs which is where it would simplify this workflow.
  • Loading branch information
wenzeslaus committed Jul 18, 2023
1 parent a2c75eb commit 52e878b
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,16 @@ It is important that "origin" points to your fork.

### Update before creating a feature branch

* Make sure your are starting with the branch for the latest version, i.e., _grass8_:
* Download updates from all branches from the _upstream_ remote:

```bash
git checkout grass8
git fetch upstream
```

* Download updates from all branches from the _upstream_ remote:
* Make sure your are starting with the branch for the latest version, i.e., _grass8_:

```bash
git fetch upstream
git switch grass8
```

* Update your local branch to match the one in the upstream repository:
Expand All @@ -98,13 +98,7 @@ git stash
git rebase upstream/grass8
```

* Apply your local changes on top:

```bash
git stash apply
```

* Remove the stash record (optional):
* Apply your local changes on top of the updated code:

```bash
git stash pop
Expand All @@ -118,7 +112,7 @@ based on it.
* Create a new feature branch and switch to it:

```bash
git checkout -b new-feature
git switch -c new-feature
```

### Making changes
Expand Down Expand Up @@ -158,6 +152,9 @@ or you can go any time later to your fork on GitHub, display the
branch `new-feature`, and GitHub will show you button to create
a pull request.

Some contributors use GitHub CLI which allows them to create the pull request
from command line in one step together with pushing the changes to GitHub.

### After creating a pull request

GRASS GIS maintainers or users will now review your pull request.
Expand Down

0 comments on commit 52e878b

Please sign in to comment.