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 alice/book
- And checks that everything is just like she left it:
git status
- 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
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 messagesgit log \
--pretty=██████:"%h%x09%Cgreen%an%Creset%x09%s (%ah) %Cred%d%Creset" \
--graph
# Check this for more info about pretty formats https://git-scm.com/docs/pretty-formats
git log \
--pretty=██████:"%h%x09%Cgreen%an%Creset%x09%s (%ah) %Cred%d%Creset" \
--graph
# Check this for more info about pretty formats https://git-scm.com/docs/pretty-formats
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 ../../