Skip to content

Latest commit

 

History

History
76 lines (54 loc) · 1.26 KB

100-log-format.md

File metadata and controls

76 lines (54 loc) · 1.26 KB

Alice: merging and log format

Our preferred writer is back, and having read Bob's message she decides to merge his work.

Lab

  • First, she jumps into her workspace
cd
cd alice/book
  • And checks that everything is just like she left it:
git status
ls
  • But Alice can confirm there is a new branch in her repo
git branch
  • So this should be an easy one: Alice merges the changes from Bob into her main branch
git merge wip-chapter-02
  • Ok, there it is the promised new chapter
ls
Alice has her preferred way to take a quick look at the repo history, and this looks like a good moment to put it in play. She uses the `pretty` option to set a particular format for the log messages
git log \
  --pretty=██████:"%h%x09%Cgreen%an%Creset%x09%s (%ah) %Cred%d%Creset" \
  --graph

Solution

git log \
  --pretty=format:"%h%x09%Cgreen%an%Creset%x09%s (%ah) %Cred%d%Creset" \
  --graph

  • Alice doesn't want to get her repo polluted with many branches created by Bob, so she deletes the new one
git branch -d wip-chapter-02
git branch
  • Well, time to drink some tea. Alice exits her repo
cd ../../