December 2018
Beginner
826 pages
22h 54m
English
Change into the example repository:
$ cd ~/example
Now, check that you're on master to start:
$ git branch* master
Good! Now, we're going to branch off from master, and make some changes:
$ git branch develop
Run git branch again:
$ git branch develop* master
Note that now, we have two branches, but we're still on the master branch. We need to run a different command to flip to our new branch:
$ git checkout developSwitched to branch 'develop'
Now, list what's in this branch:
$ lsREADME
We've effectively made a copy of the master branch, meaning that all of the files committed to that branch are available in our new one.
Let's create a new file and give it some content:
$ echo ...