Created
May 17, 2013 07:31
-
-
Save sionc/5597512 to your computer and use it in GitHub Desktop.
Branching workflow for git
This file contains hidden or 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 branch -a | |
→ Displays all branches (including remote branches) | |
git checkout -b [local-branch] origin/[remote-branch] | |
→ Create a new local-branch (e.g. test-remote) based on remote branch (e.g develop) | |
git fetch | |
→ Fetch code from remote | |
git merge origin/[remote-branch] | |
→ Merge recent changes from remote-branch (e.g develop) into currently selected local branch (e.g. test-remote) | |
git add . | |
→ Stages changes for commit | |
git commit | |
→ Opens up vi editor for commit message. Use following format for commit message in insert mode (i) | |
[Tag] Summary upto 50 chars | |
Brief description (wrap around after 72 chars or so) | |
Hit <esc> and type :wq in command mode to commit changes | |
git push origin [local-branch]:[remote-branch] | |
OR | |
git push origin [remote-branch] (if [local-branch] == [remote-branch] ) | |
→ Push changes from local branch (e.g. test-remote) into a remote branch (e.g. develop) | |
git push origin :[remote-branch] | |
→ Delete a remote branch (e.g. develop) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment