Lösung zu Schritt 1 - Klon durchführen
Erstelle einen Klon von myfirstrepo
mit dem Namen myfirstclone
.
$ git clone myfirstrepo myfirstclone
Cloning into 'myfirstclone'...
done.
Lösung zu Schritt 2 - Klon untersuchen
Schaue die Commits an und zeige den Origin des Klons myfirstclone
. origin
steht in der Regel für jenes Repository, von dem geklont wurde. Zeige dann den Status.
$ cd myfirstclone
myfirstclone $ git log --oneline
097f971 Created file bar on branch main by bjoern.
9799da6 Created file foo on branch main by bjoern.
myfirstclone $ git remote -v
origin /workspaces/git-workshop/build/git-uebungen/loesungen/repository-klonen/myfirstrepo (fetch)
origin /workspaces/git-workshop/build/git-uebungen/loesungen/repository-klonen/myfirstrepo (push)
myfirstclone $ cd ..
Lösung zu Schritt 3 - Im Klon arbeiten
Erstelle ein Commit und zeige dann den Status.
$ cd myfirstclone
myfirstclone $ # Edit file foo at line 3 on branch main by bjoern.
myfirstclone $ git commit -am "`foo`: Edit file foo at line 3 on branch main by bjoern. "
[main b654c9e] : Edit file foo at line 3 on branch main by bjoern.
1 file changed, 1 insertion(+), 1 deletion(-)
/bin/bash: line 1: foo: command not found
myfirstclone $ git status
On branch main
Your branch is ahead of 'origin/main' by 1 commit.
(use "git push" to publish your local commits)
nothing to commit, working tree clean
myfirstclone $ cd ..