Created
October 27, 2012 03:21
-
-
Save NimbusBP1729/3962825 to your computer and use it in GitHub Desktop.
Jhoff's Git Advice
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
Your master branch should always be an exact mirror of the upstream master: | |
Add upstream as a remote repository ( only need to do this one time ever ): | |
git remote add upstream https://github.com/kyleconroy/hawkthorne-journey.git | |
Everytime you want to sync master, run the following 3 commands: | |
git checkout master (next do 'git fetch upstream') | |
git pull upstream master | |
git push origin master | |
To do a new pull request: | |
Check out your master branch ( this will be used as the basis for your new branch ) | |
Make sure your master branch is synced with upstream master ( the above section ) | |
Create a new branch: | |
git checkout -b new_feature_name | |
Make changes and commit code that is all related to this feature | |
Push your new branch to github: | |
git push origin new_feature_name | |
Goto your project page on github.com and you should see a easy pull request button for the new branch. | |
Complete the pull request | |
Notes about doing branches for pull requests: | |
After you've pushed your branch to origin, sending a pull request is easy. Navigate to your repository on github.com and select the "Pull Request" button. | |
You really shouldn't ever need to merge upstream master with your branch unless something changed upstream that conflicts with your open pull request. It's actually easier for us to merge when the pull request is as simple as possible. | |
Basically, your branch is used for the sole purpose of getting your code into upstream. | |
Once your pull request has been merged by us into upstream master, it can die. | |
You don't ever want to merge your own branches back into your master. | |
Your branch code will come back into master via the pull request and upstream merge. |
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
Your master branch should always be an exact mirror of the upstream master: | |
Add upstream as a remote repository ( only need to do this one time ever ): git remote add upstream https://github.com/kyleconroy/hawkthorne-journey.git | |
Everytime you want to sync master, run the following 3 commands: | |
git checkout master (next do 'git fetch upstream') | |
git pull upstream master | |
git push origin master | |
To do a new pull request: | |
Check out your master branch ( this will be used as the basis for your new branch ) | |
Make sure your master branch is synced with upstream master ( the above section ) | |
Create a new branch: git checkout -b new_feature_name | |
Make changes and commit code that is all related to this feature | |
Push your new branch to github: git push origin new_feature_name | |
Goto your project page on github.com and you should see a easy pull request button for the new branch. | |
Complete the pull request | |
Notes about doing branches for pull requests: | |
You really shouldn't ever need to merge upstream master with your branch unless something changed upstream that conflicts with your open pull request. It's actually easier for us to merge when the pull request is as simple as possible. | |
Basically, your branch is used for the sole purpose of getting your code into upstream. | |
Once your pull request has been merged by us into upstream master, it can die. | |
You don't ever want to merge your own branches back into your master. | |
Your branch code will come back into master via the pull request and upstream merge. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment