Solution to Step 0 - START
Solution to Step 1 - Perform clone
Create a clone of myfirstrepo
named myfirstclone
.
$ git clone myfirstrepo myfirstclone
Cloning into 'myfirstclone'...
done.
Solution to Step 2 - Examine clone
Look at the commits and show the origin of the clone myfirstclone
. origin
usually stands for the repository from which it was cloned. Then show the 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-en/loesungen/repository-klonen/myfirstrepo (fetch)
origin /workspaces/git-workshop/build/git-uebungen-en/loesungen/repository-klonen/myfirstrepo (push)
myfirstclone $ cd ..
Solution to Step 3 - Work in the clone
Create a commit and then show the 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 ..