Skip to content

Instantly share code, notes, and snippets.

@ThomDietrich
Last active November 1, 2016 17:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ThomDietrich/df9fb52ac2a5be466963c3b1c219a27e to your computer and use it in GitHub Desktop.
Save ThomDietrich/df9fb52ac2a5be466963c3b1c219a27e to your computer and use it in GitHub Desktop.
How to create multiple PullRequests
I found it very useful to use a GUI in the beginning. Many might argue that only by using the command line you will really understand the git internals but that's not what you are looking for in the beginning. I can recommend **GitKraken** as an easy to use and intuitive solution and my personal favorite is **SmartGit** (powerful, free, platform independent). I can not recommend the famous SourceTree as it will just throw the command line output at you and you'll have to figure out what's going on... in this case you are better off with the command line to begin with... But that is just my opinion!
Example for what you did here, maybe it's useful to kickstart your crash course:
* The first thing you do is **create a fork** of my repository on GitHub. Neither of the mentioned clients can do that for you (there are yet other tools out there).
* Next you would **clone your repository** in SmartGit and make sure to tick **"Create upstream remote"**. This way you will not only clone your repo but also see changes in the upstream repo, i.e. mine. (the upstream repo is just the name if a second "git remote")
* Now the first thing you should always do is (visit the "Log" view and) **create a new branch** on top of the latest commit.
* Next you can do your changes, commit to your new branch and at last **push your changes** back to your repository. GitHub will now invite you to **create a PR** based on that branch.
* After the **branch was merged** you probably want to bring your repository up to date (that's the point where you deleted your fork).
* **Pull** latest changes from the upstream repository master and **Push** them to your repository master. This way you will receive the merge commit and all other changes since you created your fork.
* You can now start to create yet another branch based on this one and start from the beginning.
After a while your Log could look like this:
![2016-11-01 16_01_29-openhab-docs - log for](https://cloud.githubusercontent.com/assets/2870104/19894242/8db74ea6-a04c-11e6-93f8-ba51b397f785.png)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment