Created
August 7, 2012 21:06
-
-
Save seamusjr/3289353 to your computer and use it in GitHub Desktop.
Simple git workflow
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Git workflow example. | |
# Inspired by http://nakedstartup.com/2010/04/simple-daily-git-workflow | |
# Create a local working branch | |
# You only need to do when you want to create | |
# a local working branch for your project | |
# | |
# I use the convention feat_project_name so it can be feat_puma | |
git checkout -b branch_name_here | |
# Fetch the remote branch and merge it into your current branch | |
git pull origin master | |
# now you are ready to work | |
# Add new files as you make them | |
git add . | |
# below tells you what files have changed | |
git status | |
# below gives you a diff between changes in your branch and master | |
# can be directed at a file too | |
git diff | |
# also you can use git commit -a -m "Detailed message" | |
# the -a is for adding files that are not under version control | |
git commit -m "Detailed message here" | |
# switch back to the master branch when your feature is done and you're ready to check in code | |
git checkout master | |
# update the master with all of your changes | |
git merge branch_name_here | |
# send changes to remote repository | |
git push |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment