How to make a clean pull request on github or any git.

    Diese Seite verwendet Cookies. Durch die Nutzung unserer Seite erklären Sie sich damit einverstanden, dass wir Cookies setzen. Weitere Informationen

    • 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/oy/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/oy/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 1 - add remote
      http://img8.imageshack.us/img8/7497/15322486.th.png

      http://img269.imageshack.us/img269/218/addremote.png

      Step 2 - Fetch

      http://img683.imageshack.us/img683/2702/fetcho.png

      then choose oy or the remote you just created then ok
      Step 3 - creating a branch

      http://img193.imageshack.us/img193/9584/73551391.th.png

      http://img96.imageshack.us/img96/1740/57183307.png

      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
      http://img27.imageshack.us/img27/889/38096234.th.png

      http://img141.imageshack.us/img141/8740/67413765.th.png

      Step 6 - push

      http://img8.imageshack.us/img8/7497/15322486.th.png

      http://img684.imageshack.us/img684/5879/77418250.th.png

      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
      http://img831.imageshack.us/img831/9682/stashr.th.png
      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
      http://img156.imageshack.us/img156/2268/showlog.png
      then right click the commit you want to reset to
      and then choose
      http://img37.imageshack.us/img37/1221/resetz.th.png


      Step 7 In details

      in your repo screen click pull request
      http://img24.imageshack.us/img24/139/repo.th.png

      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
      http://img714.imageshack.us/img714/4186/defaultpull.th.png

      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
      http://img840.imageshack.us/img840/8340/defaultcommitrange.th.png
      to
      http://img10.imageshack.us/img10/7555/updatecommitrange.th.png

      OR

      you can choose some commits instead of all commit differences inside a branch:
      see this branch here has 3 commits
      http://img203.imageshack.us/img203/5248/whereyp.th.png
      if i wanted to choose the 1st commit only
      would paste 34731674 instead of FreezeTest on the right in this picture:
      http://img840.imageshack.us/img840/9434/branchy.th.png

      or 57e53092 for the 1st 2 commits
      Note: 57e53092  or 34731674  are commit hashes that can be found in the commits diff page

      http://img203.imageshack.us/img203/5248/whereyp.th.png

      after filling and checking the branch names
      http://img59.imageshack.us/img59/6696/finaliz.th.png
      click send pulll request

      weiterlesen