Git Workflow For Beginners

When I first started to learn git I found it terribly unintuitive. What the heck is master and why I am not the master on my own computer?! She has been lying to me all along, wench…grrr.

No one wanted to give me a simple workflow. Because it always “depended on what I was doing.” This is true but I am going to give out a workflow anyway. Here is the one I wish I had when I first started to learn git. Enjoy.

Note: Commit early and often. This will save you from doing too much damage as you’re learning version control.

Step 1 – See what branch you’re on:

git status

You want the output to look something like this:

# On branch master

Step 2 – Create a new branch:

git co -b "name_your_branch"

Code on this branch.

Step 3 – Checkout Master Branch

git checkout master

Step 4 – Pull in changes that may have been made while you were working on your branch

git pull origin master

Step 5 – Merge your branch

git merge name_your_branch

Step 6 – Push your branch “up to” master

git push origin master

rinse, repeat….