Intro to git 1

git commit -m "C0" --allow-empty

vim some_work.py;, (…), git add some_work.py

git commit -m “C1”

git tag v0.1

vim some_work.py; (…); git add some_work.py

git commit -m “C2”

git log (note the tag v0.1 has not moved)

git tag v0.2

Email from colleague

Dear Alice and Bob,

Alice,

  • your job is to fix bug #58.
  • Please start from our current main branch (which today is tagged v0.2)
  • Fix the bug in a branch bugfix58 and merge back to main when you are done.

Bob,

  • your job is to implement feature #4
  • Please start from our current main branch (which today is tagged v0.2)
  • Implement the feature in a branch feature4 and merge back to main when you are done.

As Alice’s laptop is broken, you will be working on the same laptop this week; we will talk about remote repositories in the future.

Current state

git branch feature4

git branch bugfix58

Bob gets to work.

git checkout feature4; vim some_work.py; git add some_work.py

git commit -m “C3”

vim some_work.py; vim another.py; git add *.py

git commit -m “C4”

git checkout v0.1

git checkout main

git checkout 60b26f

git tag tag_sth

Alice gets to work (Goal: fix bug 58)

git checkout bugfix58

git checkout bugfix58

vim some_work.py; vim test_00.py; git add test_00.py

git commit -m ‘D3’

git add some_work.py

git commit -m ‘D4’

git log

Bob gets a little bit more work done.

git checkout feature4

vim another.py; git add another.py

git commit -m “C5”

git log

git log (terminal output)

git log –all –decorate –oneline –graph

git lg (from https://stackoverflow.com/a/9074343)

git tably (from https://stackoverflow.com/a/61487052)

Merging Alice’s work on bugfix58 onto main

git checkout main && git merge bugfix58

git log

git checkout main && git merge feature4

git log

git lg; git tably