Topic: [DEVELOPMENT] How to make a clean pull request on github or any git
Introduction
First you need some git knowledge search online for some tutorials for basic info.
now before you start editing you need to have a clean working dir.
if you don't have a clean working dir here is how to clean it up and keep the current changes
git stash save
this will save you changes later you can do
git stash pop
how to clean it up and lose the changes
git reset --hard
now to start making changes cleanly to make a pull request with it you need to have the latest changes from the main teeworlds repo https://github.com/teeworlds/teeworlds
I am assuming you have a teeworlds repo already cloned.
Note For the Windows GUI stash or Reset Stuff you can look to the bottom of the guide
All OSes Command Line
Do this:
1- git remote add oy git://github.com/teeworlds/teeworlds.git
2- git fetch oy
3- git checkout -b oypullrequest1 oy/master
4- do what ever changes you want
5*- git commit -a -m"Example commit message"
6- git push origin oypullrequest1
7- make a pull request from yourrepo:oypullrequest1 to oy'srepo:master
7- details in the end of the post
this way you will have a clean pull request
*p.s. step 5 may not be the best way to commit if you have your .gitignore messed up, please consult other online guides on how to commit the best way that suites you.
ALSO: this is VERY IMPORTANT make your commit message something relevant to what you did and make it professional so that the puller of this commit will not be ashamed to pull it in his repo
Last Steps works for all operating systems on all usable git versions.
Windows GUI (Tortoise git)
the next is for windows Tortoise git, i will assume u read all of the above.
Step 2 - Fetch
then choose oy or the remote you just created then ok
Step 3 - creating a branch
Step 4 - do what ever changes you want
Step 5 - commit
VERY IMPORTANT make your commit message something relevant to what you did and make it professional so that the puller of this commit will not be ashamed to pull it in his repo
Step 6 - push
Step 7 - do a pull request on github
details in the end of the post
P.S.
if you need The stash stuff or git reset here is how to do it.
Stash
1- saves your current changes
2- applies the latest saved stash but doesn't delete it ( i am not sure )
3- applies the latest saved stash and deletes it
4- shows all stashes
Git Reset
to do git reset you need to use
then right click the commit you want to reset to
and then choose
Step 7 In details
in your repo screen click pull request
you will probably get a destination branch that you don't want and a source branch that you don't want
so click change commits
change the left drop down to the target person's repo and type in the branch name
change the branch name on the right to oypullrequest1 or what ever u named it
from
to
OR
you can choose some commits instead of all commit differences inside a branch:
see this branch here has 3 commits
if i wanted to choose the 1st commit only
would paste 34731674 instead of FreezeTest on the right in this picture:
or 57e53092 for the 1st 2 commits
Note: 57e53092 or 34731674 are commit hashes that can be found in the commits diff page
after filling and checking the branch names
click send pulll request