checkout the repo (git checkout)
run pull in any changes that have been sent to repo during my work time (git pull)
commit my changes to the repository (git push)
Recently I had a need to do more, though. There's one section of one of web applications I'm developing that needs a serious redesign (I mean several days worth of work). So I'm working through it, but then I have a new "emergency" that comes in that requires I deploy some code NOW. Usually, I could solve this problem by making the change in my working directory, and then just selectively adding and commiting that change. However, some of the work I needed to do was in one of the files I had already edited, so there was no way without losing all my work for the day that I could swing getting this fix out (short of checking out from head to a different folder, changing, pushing, and then pulling in to my modded directory again).
Fortunately, git provides a better way:
$> git stash save
I've just saved all my local modifications to the "stash", which you can think of as a temporary shelf you can set stuff on while you're doing branching stuff.
$> git checkout -b working_branch
Now I've created a new branch named "working_branch" on my machine from this repository.
$> git stash apply
My changes that I saved to the stash have now been resurrected and applied to the new branch that I'm working in. I can now make changes and commit to the "working_branch" branch as often as I need.
$> git add .
$> git commit -m "commiting to branch"
Now I need to go back to my master branch to make the emergency change:
$> git checkout master
OK, make my emergency fix, then commit:
$> git add .
$> git commit -m "commiting to master"
$> git push origin master
Now maybe I want to merge these emergency changes into my current working branch so that I can keep the two branches from diverging to far:
$> git checkout working_branch
$> git merge master
Resolve any conflicts, and commit. Done!
There you have it, simple branching in git for great gains in organization and productivity (IMHO).