Skip to content

Commit 585e9b8

Browse files
authored
Merge pull request #8 from esciencecenter-digital-skills/7_update_section_4_software_sustainability
Update section 4
2 parents 82bca27 + 467d819 commit 585e9b8

5 files changed

Lines changed: 535 additions & 384 deletions

File tree

episodes/41-code-review.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,27 @@ This tells the author you are happy for them to merge the pull request.
567567
![](fig/github-merge-pull-request.png){alt='Merging a pull request in GitHub' .image-with-shadow width="800px"}
568568
2. Delete the merged branch to reduce the clutter in the repository.
569569

570+
::: callout
571+
572+
### Merge via command line
573+
574+
The `git merge` command provides a way to directly merge branches on your local. In general, when adding changes to the major branches like `develop` or `main`, this is not a good practice since it bypasses the code review process. It is a common practice for an open-source project to protect its most important branches, meaning pushing directly to one of these branches will fail. Therefore, even if you can merge to `develop` or `main` locally, you will not be able to push the changes to the remote repository.
575+
576+
On the other hand, the `git merge` command can be very useful for keeping your feature branch up to date with the major branches. For example, if you are working on a branch `my-feature` and the `develop` branch has received new commits (e.g. someone else has merged their pull request), you can do the following to include changes from `develop` into your feature branch:
577+
578+
```bash
579+
# First update your local develop branch
580+
$ git checkout develop
581+
$ git pull develop
582+
# Then switch back to your feature branch and merge the latest develop into it
583+
$ git checkout my-feature
584+
$ git merge develop
585+
```
586+
587+
In this way, you can keep your feature branch up to date. You may need to resolve conflicts that arise during this process.
588+
589+
:::
590+
570591
## Writing Easy-To-Review Code
571592

572593
There are a few things you can do to make it

0 commit comments

Comments
 (0)