HACKTOBERFEST-How I Successfully made my first Pull Request

Fanny Nyayic
3 min readOct 21, 2019

--

Hacktoberfest — 2019

Fundamentally, pull requests are the mechanism for contributing to a group project. From what I learned, Pull requests are also the heart of open source code and the pivot upon which GitHub group projects turn.

Becoming an open source contributor is a natural extension to the process of becoming a more advanced programmer: as you start incorporating these awesome open-source resources in your own code, you will start to notice bugs or maybe think of a useful new feature that could be added.

This is where pull requests come in an this is how I successfully made my first PR with the help of facilitators J Edison Abahurire and gideon bamuleseyo.

Step 1:I Forked the original project into my own GitHub account and then cloned it to my computer.

I forked the original project https://github.com/devckla/hacktoberfest-kla-2019 to get an entire current working copy of the codebase into my own hands and then cloned it down to my local working environment to begin working that coding magic.

If you’re not sure how to do this, or maybe just rusty, please go review the forking and cloning tutorial.

Step 2: I Made a local branch for my new code.

Once the project is all fired up in my local work environment, the first thing I did is create a brand new branch for my brand new code. This is because, when I cloned the repo to my computer, I set up a copy of the master branch from the main online project repository. Remember our rule: Don’t Mess With Master. Creating a new branch for experimenting and changing things is always a good idea, whether working on your own small project or contributing to a group effort. PRs are no exception. While you’re at it, be sure to give the new branch a short but informative name that reflects the work you’re doing.

Step 3: Create!

This is where I dug into the code I just downloaded and made the changes/additions I dreamed up. So! In the terminal, please change directory (cd) to the root directory of the project — i.e., the directory called hacktoberfest-kla-2019 that I cloned to my computer. I edited the ReadMe file and added my name to the list of contributors.

Step 4: Merge your branch into master, then delete it.

Having made my addition to the project on my practice branch, it’s time to merge the changes back into master: in the terminal, $git checkout master to switch from your temporary branch to master. Then $git merge branch_name

Once successfully merged back into master, delete your branch. You’ll never use it again, and there’s no point pushing cruft to GitHub. $git branch -d branch_name. Should be a straightforward merge, but again, if you run into trouble, consult Working with Branches in Git article.

Step 5: Stage. Commit. Push.

Pretty sure I got this core part of the GitHub workflow down, but now is the time when you $git add, $git commit, and $git push -u origin master your newly created file. Step 6: Your First Pull Request

Now comes the big moment: My first pull request!

Go back to the original https://github.com/devckla/hacktoberfest-kla-2019 on GitHub — not your own page, but the one you first forked the practice exercise from.

Click the tab that says “ Pull Requests.”

Click on “New Pull Request”

New Pull Request
create a pull request, write a comment and submit

After creating the pull request, look for another project and repeat these steps.

Goal: Open source contribution.

Good Luck!

--

--

Fanny Nyayic

“Software Developer | Tech Writer | Open-Source Contributor”