From cf5b543f6b1f11d6ff347b78a3c5cba367ef1b42 Mon Sep 17 00:00:00 2001 From: Radovan Bast Date: Wed, 6 Mar 2024 22:08:36 +0100 Subject: [PATCH] update the "finding the balance" part --- content/level.md | 14 +++----------- content/what-to-avoid.md | 1 + 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/content/level.md b/content/level.md index 83fdcfee..9a9e146d 100644 --- a/content/level.md +++ b/content/level.md @@ -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`. --- @@ -70,4 +63,3 @@ How do you [plan to] use Git? - Advanced users or beginners, please provide your input in the online collaborative document. ``` - diff --git a/content/what-to-avoid.md b/content/what-to-avoid.md index 778d27d0..399521fe 100644 --- a/content/what-to-avoid.md +++ b/content/what-to-avoid.md @@ -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.