ANDREAS SCHIPPLOCK
Programmer, Linux user since ~2000.


Working on a branch

Because it's not a good idea to work on the master branch, let's create a branch.

Creating a branch is easy:


git branch fix-readme
Make sure the branch has been "created":


git branch
You will get an output similar to this:


fix-readme
* master
This output means: there are 2 branches in total. The one prefixed with the * is the active branch. So currently "master" is active. We don't want that.

You can switch to the newly created branch with:


git checkout fix-readme
Modify README.md, add the changes (git add README.md) and commit the changes (`git commit -m "modified README.md").

This commit happened in the fix-readme branch and you now want it to be merged into the master branch.

For this you need to switch to the `master` branch:


git checkout master
...and simply `merge` the changes from the `fix-readme` branch:


git merge fix-readme
You will get an output similar to:


Updating 649a532..a37a62c
Fast-forward
 README.md | 1 +
 1 file changed, 1 insertion(+)