From 83c5c47b43c03214e689640e86ae85d7cecfda5b Mon Sep 17 00:00:00 2001 From: Radovan Bast Date: Sun, 1 Sep 2024 18:37:21 +0200 Subject: [PATCH] make it easier to compare branches; closes #457 --- content/commits.md | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/content/commits.md b/content/commits.md index b0387bf..aa59ccb 100644 --- a/content/commits.md +++ b/content/commits.md @@ -1,6 +1,6 @@ # Committing changes -The first and most basic task to do in Git is *record changes* using +The first and most basic task to do in Git is **record changes** using commits. In this part, we will record changes in two ways: on a new branch (which supports multiple lines of work at once), and directly on the "main" branch (which happens to be the default branch here). @@ -40,8 +40,9 @@ can merge them together easily. Image created using We offer **three different paths** of how to do this exercise. For the CodeRefinery workshop day 1, we use and demonstrate the **GitHub -path** only and recommend you do that. (You can get experience with -the other paths on day 2) +path** only and recommend you do that +(you can get experience with +the other paths on day 2). :::{exercise} Exercise: Practice creating commits and branches (20 min) 1. Make sure that you now work **on your fork** of the recipe-book @@ -112,7 +113,7 @@ name of the thing you make. A commit is identified by something such as :width: 60% :class: with-border ::: -1. Change to some sub-directory, for example `sides` +1. Change to some sub-directory, for example `sides`. 1. Make sure you are still on the `new-recipe` branch (it should say it at the top), and click "Add file" → "Create new file" from the upper right. @@ -316,13 +317,9 @@ it makes sense later on. :::::{tabs} ::::{group-tab} GitHub -Next to the branch name switcher, click on "Branches" to get an overview. - -Another way to compare branches or commits on GitHub is to adjust the following URL: -`https://github.com/USER/recipe-book/compare/VERSION1..VERSION2` - -Replace `USER` with your username and `VERSION1` and `VERSION2` with a commit hash or branch name. -Please try it out. +A nice way to compare braches is to add `/compare` to the URL of the repository, +for example (replace USER): +`https://github.com/USER/recipe-book/compare` :::: ::::{group-tab} VS Code @@ -353,7 +350,8 @@ This is similar to above, but not only between branches. :::::{tabs} ::::{group-tab} GitHub -Like above, one can compare commits on GitHub by adjusting the following URL: +Following the `/compare`-trick above, one can compare commits on GitHub by +adjusting the following URL: `https://github.com/USER/recipe-book/compare/VERSION1..VERSION2` Replace `USER` with your username and `VERSION1` and `VERSION2` with a commit hash or branch name.