Skip to content

Commit

Permalink
update the "finding the balance" part
Browse files Browse the repository at this point in the history
  • Loading branch information
bast committed Mar 6, 2024
1 parent 40e11dc commit cf5b543
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
14 changes: 3 additions & 11 deletions content/level.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,19 @@
- You create new feature branches for changes.
- Changes are reviewed before they are merged to the `main` branch
(more about that in the [collaborative Git lesson](https://coderefinery.github.io/git-collaborative/)).
- The `main` branch is write-protected and can only be changed with pull requests or merge requests.


### When you distribute releases

- If you want to patch releases, you probably need release branches.
- The `main` branch and release branches are read-only.
- Many [branching models](https://coderefinery.github.io/git-branch-design/05-branching-models/) exist.
- Consider to write-protect the `main` branch so that it can only be changed
with pull requests or merge requests.

---

## How about staging and committing?

- It is OK to start committing directly by doing `git commit SOMEFILE`.
- Commit early and often: rather create too many commits than too few.
You can always combine commits later.
- Once you commit, it is very, very hard to really lose your code.
- Always fully commit (or stash) before you do dangerous things, so that you know you are safe.
Otherwise it can be hard to recover.
- Later you can start using the staging area.
- Later you can start using the staging area (where you first stage and then commit in a second step).
- Later start using `git add -p` and/or `git commit -p`.

---
Expand All @@ -70,4 +63,3 @@ How do you [plan to] use Git?
- Advanced users or beginners, please provide your input in the online collaborative document.
```

1 change: 1 addition & 0 deletions content/what-to-avoid.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ than doing work and then noticing a lot of conflicts because
unrelated but conflicting work was done in the meantime or even before you started. Or noticing that someone
else has already done it. This problem is largest when you come back
to an active project weeks or months later.
So update your branch before adding new commits.

**Commit unrelated changes together**: Makes it difficult to undo changes since
it can undo also the unrelated change.
Expand Down

0 comments on commit cf5b543

Please sign in to comment.