Solution to Step 0 - START

Solution to Step 1 - Fetch changes

Fetch the two new commits from the origin repository without changing the local main.

mein-klon $ git fetch

From ../blessed
6014eb9..0b4e6c2 main -> origin/main

The output shows that changes on the main branch have been fetched.

mein-klon $ git status

On branch main
Your branch and 'origin/main' have diverged,
and have 1 and 2 different commits each, respectively.
(use "git pull" if you want to integrate the remote branch with yours)

nothing to commit, working tree clean

Solution to Step 2 - Examine changes

Show the status, and then examine which commits are present in the main of the origin repository, which have not yet been integrated into the local main.

mein-klon $ git status

On branch main
Your branch and 'origin/main' have diverged,
and have 1 and 2 different commits each, respectively.
(use "git pull" if you want to integrate the remote branch with yours)

nothing to commit, working tree clean

The status shows that there are two commits in the origin repo (on the main branch) that we have not yet integrated.

mein-klon $ git log main..origin/main

commit 0b4e6c2d582e300fd5ebc1cbe17e7a3f6641f02c
Author: bjoern <kapitel26blog@gmail.com>
Date: Thu Jul 29 00:00:00 2021 +0000

: Second edit after cloning

commit 47ce9cff6da38bc51b508a0d9b238d4d3da1da9e
Author: bjoern <kapitel26blog@gmail.com>
Date: Thu Jul 29 00:00:00 2021 +0000

: First edit after cloning

The .. notation shows exactly those commits that are in origin/main but not yet in main. A shorter way to write this would have been git log ..origin/main, since main is currently HEAD.

Solution to Step 3 - Integrate changes

Integrate the latest commits from the origin repository into the local main.

mein-klon $ git pull

Merge made by the 'ort' strategy.
foo | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

mein-klon $ git log --graph --oneline

* b94c0a2 Merge branch 'main' of ../blessed
|\
| * 0b4e6c2 : Second edit after cloning
| * 47ce9cf : First edit after cloning
* | 4554415 : My local edit
|/
* 6014eb9 Initial edit before cloning
* de06cfe Initial edit before cloning

To the exercise

To the overview