With a clean master branch checked out, you can create a task branch by typing:
where the task_branch is the name of the branch you want to create. By using the -b option it will both create a new branch and check it out.
git checkout -b task_branch
As your are doing work you can commit regularly, and you must also commit when you are finished with your task. You can commit by typing:
and you should leave a detailed commit message describing the changes you made.
git commit -am "commit message"
Now that you've finished your task you need to checkout master and merge your work. To checkout master simply type:
and to merge your task branch type:
git checkout master
where task_branch is the name of your branch.
git merge task_branch
Now that your work is merged, go ahead and push the master branch by typing:
git push origin master