Confirmed users
182
edits
mNo edit summary |
No edit summary |
||
Line 22: | Line 22: | ||
*Make sure that you have a clone of the Mozilla repository on your local machine | *Make sure that you have a clone of the Mozilla repository on your local machine | ||
*'''git branch ''pullrequest''''' | *'''git branch ''pullrequest''''' | ||
This will create another branch (a working copy), called ''pullrequest'', with the code of the current branch) | |||
*'''git checkout '''''<b>pullrequest</b>'' ... for the impatient, '''git''' '''checkout -b ''pullrequest'''''<br> | *'''git checkout '''''<b>pullrequest</b>'' ... for the impatient, '''git''' '''checkout -b ''pullrequest'''''<br> | ||
Switches to your new branch ''pullrequest''. The reason for doing it in a branch is if there are conflicts it won't break you local master. If you should indeed mess up your branch, you can always create a new branch off your ''master'' branch!<br> | Switches to your new branch ''pullrequest''. The reason for doing it in a branch is if there are conflicts it won't break you local master. If you should indeed mess up your branch, you can always create a new branch off your ''master'' branch!<br> | ||
*'''git remote add '''''<b>requestee requestee_git_fork_url</b>'' | *'''git remote add '''''<b>requestee requestee_git_fork_url</b>'' | ||
*'''git fetch''' '''''requestee''''' '''&& git merge''' '''''requestee/pull_request_branch_on_their_fork''''' | ''This command will introduce your clone of the repository with the repository you want to merge with (most of the time, this is the mozilla repository). '''''Example:'''''<b>git </b>'''remote add'''''<b>mozilla</b>'''https://github.com/mozilla/Addon-Tests.git'''''will save the Addon-Test repository under the short, and easy-to-remember name ''mozilla''.<br>'' | ||
*'''git fetch''' '''''requestee''''' '''&& git merge''' '''''requestee/pull_request_branch_on_their_fork''''' | |||
Get the latest data from the remote repository 'mozilla' and integrate it with your current working branch. '''''Example:''''' '''git fetch ''mozilla'' && git merge '''''<b>mozilla/master</b>'' will get all the stuff from the mozilla repository (1st step) and then merge the '''''master''''' branch of '''''mozilla''''' with the data of your branch, thus keeping it up-to-date! | |||
*Run the tests | *Run the tests | ||
**Sometimes good looking code doesn't actually work so lets prove it works! | **Sometimes good looking code doesn't actually work so lets prove it works! | ||
**If, and only if, it passes do the next steps | **If, and only if, it passes do the next steps | ||
*'''git checkout '''''<b>master | *'''git checkout '''''<b>master</b>'' | ||
*'''git merge '''''<b>pullrequest master</b>'' | |||
*'''git push ''origin master''''' | ''Switch to your ''master'' branch | ||
*'''git branch -d '''''<b>pullrequest</b>'' | |||
*'''git merge '''''<b>pullrequest master</b>'' | |||
Merge your branch (working copy)''pullrequest ''with the current master branch | |||
*'''git push ''origin master''''' | |||
Push the changed stuff in your master branch back to your origin repository at github | |||
*'''git branch -d '''''<b>pullrequest</b>'' | |||
Delete the working branch you created, as everything is now merged with your master branch | |||
This will have it all stored in the remote master and you will have a clean version locally. Please **don't** use the merge button on GitHub. You **need** to verify that the merge works and that button can't do that for you! | This will have it all stored in the remote master and you will have a clean version locally. Please **don't** use the merge button on GitHub. You **need** to verify that the merge works and that button can't do that for you! |