Like A Girl

Pushing the conversation on gender equality.

Code Like A Girl

Come let’s get the Hacktoberfest T-shirt together: A Beginner’s Guide

Ps: This post is solely intended to motivate more people to make open source contributions. If you have used GitHub before and have a good grasp on any programming language then I urge you to delve deep into code bases of repositories other than the ones used in this article to make your contributions.

I personally love this years colour way more than last years 😛

What is Hacktoberfest?

Hacktoberfest is a month-long celebration of open source software run by DigitalOcean in partnership with GitHub and Twilio.

  • Hacktoberfest is open to everyone in our global community!
  • Five quality pull requests must be submitted to public GitHub repositories.
  • You can sign up anytime between October 1 and October 31.

Why am I writing this post?

While interning at IIIT Hyderabad this summer I spotted several people everyday on their campus who took pride in wearing HackerRank/ Hacktoberfest/ Codechef T-shirts.It was like a tradition on their campus.

I feel these external factors can act as motivators for their peers and have a great impact on the college’s coding culture . Hence I would love to see more people at my college also have these goodies that not only showcase their skill but also inspire their peers.

What do you need to do before making contributions?

  • Create a GitHub account (Sign up here)
  • Register for Hacktoberfest using your GitHub account (Register here)
  • Check if you have Git installed on your computer, if you don’t then install it

To check if you have Git installed, open the terminal and type(Ubuntu) :

git --version

If it is installed then you should get something like this:

If you don’t have it then to install it, type

sudo apt install git // to install git 
git --version //to check if its installed successfully

Now you’re all set so lets jump right in.

Open your browser and go to this repository on Github. Scroll down and read the portion which mentions the details regarding making contributions.

To start, click the fork button on the top right. Forking a repository basically creates a copy of the repository for you. The copy is linked to your account.

Click on the Fork button: Top Right

After clicking on the Fork button the screen would look something like this:

And then finally you will see your copy of the repository. You can tell its your version because now your username would show up on the top left before the file name. Now click on the clone button and copy the link given.

Create a folder on your computer for Github (if this is your first time).

git init //needed only for first timers

Using the command line navigate to the Github folder. And clone the repository to create a remote version of it on your computer.

cd Documents/Github 
git clone --paste the link you copied here--

Once this is done, go to the Github folder that you created on your computer. A new folder inside it would have been automatically created with the same name as the repository cloned.

Now following the instructions make your contribution to the respective file in the folder. In this case, open the index.html file and add your details.

Now go to the terminal to sync your remote repository (the one on your computer)with the upstream version(the owners version not your forked version). The easy way out would be to skip this step however that defeats the whole purpose of version control. It is important to sync the file with the upstream version so in case someone else pushes their code to the upstream repository while you are still making changes to the files on the remote repository, the latest version can still be pulled without any conflicts.

To sync the repository type

git remote add upstream --paste owners repository link here--
git remote -v //to check

If done correctly the result would be something like this:

Now add, commit and push your changes to the repository using the following commands

git add -A 
git commit -m "type your message here"
git push origin

Now open your browser and go to your repository on Github. If the changes were successfully pushed you can see the time next to the file (that you made changes to)would have been updated like this:

This is the forked version not the owners version

Now to update the owners version of the repository we make a pull request by clicking on the New pull request button (top left). When you do so, this page would show up

Click on Create pull request and fill in the required details.

Finally click on the green Create pull request button(bottom right).

Congratulations! You have successfully created your first Hacktoberfest pull request. You can go the Hacktoberfest website and click on the check your progress button. It would look something like this after you make your first pull request:

You need to make 4 more pull requests to get the Tshirt. So go on Github and search for repositories with the Hacktoberfest tag. To do so, just go to the search bar on Github and type Hacktoberfest. Pick any 4 repositories that you are comfortable with after reading the requirements mentioned in their

Repositories you can make quick contributions to:

Finally when you’re done your progress page will look like this:

So go for it, Get the Tshirt. Happy Hacking!