I'm sure many of you have done the following:
- Google: "How to make make a pull request"
- Cry when you see the long string of commands that need to be entered and memorised.
It doesn't need to be that complicated.
I myself have spent many years using the CLI making many, many mistakes. I just recently moved to GitHub desktop it is so much faster and just an all-round more pleasant experience.
Step 1 - Install GitHub desktop
Go to https://desktop.github.com/ and download the GitHub desktop. Once downloaded and installed I'd recommend having a little watch of this video to get up to speed with it โ it's definitely worth a watch:
Step 2 - Fork the repository you want to make the pull request to!
Go to the repository โ at the top right of the page, there should be a fork button!
In this example, I am going to make a pull request to a friend's repository and just update their readme.md
Step 3 - Clone the forked repository using GitHub desktop
Step 4 - Make and commit your changes
Push the changes to your forked repository:
Step 5 - Make the pull request!
Go to your forked repo on Github and make sure your changes have been added:
Click New Pull Request:
Check over the changes then click Create Pull Request!
Finally, wait for your beautiful code to be merged!
That's all there is to it, it's very simple and the GitHub desktop tool helps speed up the process โ it also helps in actually understanding what these bloody commands are doing!
I hope this helps, happy hacking!
Thank you, if you like my rambling check out my personal blogging site at https://codeheir.com/
This blog is sponsored by Code Canvases
Make your room come alive with the coolest programming/coding canvases on the market. codecanvases.com is the number 1 seller for programming prints with 100% exclusively designed canvases. Get them now whilst they're 20% off!!
Top comments (12)
Better than GitHub Desktop you have GitKraken :D Available on Windows, Mac & Linux.
Good post by the way.
ooh It looks really good, and a 3-way merge tool built-in! ๐ Thank you
You're welcome ๐
I will say though, It's a little less beginner-friendly than Github desktop there are many, many more options for things which may be a little daunting for newcomers!
Personally since a friend of me made me discovered GitKraken I am in love with it.
Before, I was commiting only with terminal commands, but I found the GUI way more convenient. It's easy to see the last commits, branches etc ...
I really love Gitkraken. Must say that I took it because of its Linux compatibility but it is my go-to Git client (when not using the CLI) because of all the features it has and the design that makes everything pretty clear.
Nevertheless, some VSCode add-on are pretty good as well.
Git File History => marketplace.visualstudio.com/items...
and
Git Graph => marketplace.visualstudio.com/items...
The GitHub
hub
command line tool is much simpler. github.com/github/hubhub pull-request --no-edit -p -o -b master
Pushes your branch to remote (
-p
), makes the PR using your commit messages (--no-edit
), asks to pull the changes into the master branch (-b master
), and even opens it in the browser once done (-o
).Thanks for this command. Been using hub but didn't know it can do that.
I think, you should add one step โ create branch for your commits. 1 branch โ 1 PR for 1 issue. It will be better, than a lot of commits in 1 PR with different issues.
Nice post!
Isn't the easiest way is still to create in on GitHub from branch?
This is good! You can use the desktop app too. Since I work in Linux using the CLI is the best choice.
sudo git clone --single-branch -b Dev git@github.com:UserName/gitRepo.git
I usually just make github PRs right on Github.com