4 ms·
Yes, but this particular tutorial is just exceptionally bad. It doesn't even tell you in plain English that a new branch is being created - it just says nothing
by msravi 9y ago
Yes, but this particular tutorial is just exceptionally bad. It doesn't even tell you in plain English that a new branch is being created - it just says nothing seems to have changed with -b, that an overwriting seems to be an illusion, and that you can restore the original by checking out master! The author seems to have gone to extraordinary lengths to not use the term "branching". That does not help in usage, despite being termed Usage-First
From the tutorial:
We have created a Git repository that tracks one text file containing a certain message. Now type:
$ git checkout -b boss # nothing seems to change after this
$ echo "My boss is smarter than me" > myfile.txt
$ git commit -a -m "Another commit"
It looks like we’ve just overwritten our file and committed it. But it’s an illusion. Type:
$ git checkout master # switch to original version of the file
and hey presto! The text file is restored.