Created
November 9, 2011 20:44
-
-
Save zeke/1352951 to your computer and use it in GitHub Desktop.
git_workflow.sh
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
# (Assuming master is your main branch) | |
# To create a local branch | |
git checkout -b experiment | |
# To push a local branch to remote | |
git push origin experiment | |
# To check out an *existing* remote branch | |
# (In earlier versions, you needed an explicit --track option, but now it's the default when branching off a remote branch) | |
git checkout -b test origin/test | |
# Make your changes and commit | |
git commit -a -m "DEV-1234 did some really crazy stuff" | |
# 1. Rewind your changes | |
# 2. Pull down the latest changes from master | |
# 3. Apply them to your branch | |
# 4. Reapply your changes | |
git pull --rebase origin master | |
# Go back to master and merge in your local branch | |
git checkout master | |
git merge experiment | |
# Delete the local branch | |
git branch -d experiment | |
# Delete the remote branch | |
git put origin --delete experiment | |
# or.. | |
git put origin :experiment |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment