HNG Internship 2018 Stage 2 - Git And Github For Code Collaboration

25 April 2018 - 5 mins read

Right, been a minute since we spoke and last time you got to take a look at some cool designs that people created in stage 1 of the HNG Internship. Well, today we’ll be taking a look at what stages 2 had in store for people.

After, completing stage 1 which proved to be a bit challenging given how it tested multiple skills like designing and coding mainly in HTML and CSS, stage 2 was a welcome refresher to some.

HNG Internship Stage 2 Tasks - Git And Github

The tasks for stage 2 were mainly centred around getting to know Github, the widely used online platform for code collaboration so that you could get familiar with how to work with others on the same files in a single project.

To achieve that goal, the tasks could be split into two major parts.

Part 1 - Introduction to Git and Github

  1. Create a Github account
  2. Create a new repository within your account
  3. Push the HTML and CSS files to that repository
  4. Post your repository URL to the #results channel
  5. Alert a mentor to add you to the HNG 4.0 Github organization

As you can see the tasks here are focused more on giving an introduction to what Git and Github are all about by completing a simple task of getting the code you’ve already written online.

Most of the work would be spent around reading about what the Git and Github are and understanding them then once done it’s as simple as typing a few commands to complete the task. However, part 2 kicks the difficulty up a notch by introducing the element of using these technologies, which you would have a basic understanding of at this point, for collaborating with other developers.

Part 2 - Collaborating with others using Git and Github

When you complete the first part of stage 2 you’ll be added to the HNG Internship Github organization so that you can get access to repositories of projects that are currently being worked on so that you can start to learn how to actually leverage the newly learned technologies for project collaboration.

Due to that, the tasks for the second part of stage 2 focus on that aspect of collaboration more and they are as follows.

  1. Clone the HNG 4.0 repository
  2. Open contributors.txt and add your name at the end of the file
  3. Commit your changes
  4. Pull changes from the remote repository
  5. Resolve any merge conflicts
  6. Push your code to the repository
  7. Alert a mentor to review

Most of the steps should already be familiar after completing the first part of stage 2 like cloning a repository, editing some files, committing those changes and sending them back up to Github from your local repository on your computer.

However, things can get quite messy real quickly because now it’s not just you changing files and uploading them to Github. You and other interns are editing the same file probably at the same time in some cases and trying to upload your changes back to Github.

Since each person who is supposed to add their name has to do so at the end of the file it means that everyone will be editing literally the same line in the file. So if you add your name at number 386 and another intern had beat you to the punchline by uploading their changes with their name at number 386 then your changes will be rejected when you try to push them to to the remote repository.

So you’d have to first get any changes that are already existing in the remote repository but you didn’t have in your local repository then if there are any conflicts like we just saw, your task would be to fix them. Usually means you moving your name to the end of the file onto the next available number because number 386 is already taken.

My Experience With Stage 2 Of The HNG Internship 2018

For me, stage 2 took the least amount of time and effort. Simply because I’ve been working with Git and Github on my projects including this website since 2016 so I already knew some of the gotcha moments that could arise from doing this task.

However, looking back to what I said when we started talking about this internship, if I had taken part in it right when I was starting my coding journey then it would have probably taken me a while to complete stage 2.

Hear from other interns to get a sense of what I mean:

Git/Github is not as simple as it looks. The commands are too much. - Busola Adedoyin

While using Git, I told myself, “If I don’t die now, nothing can kill me again” but I won’t say it out loud cuz I know there are more stages to come - Linda Okorie

Git/Github has taught me patience this past two days - Rawlings Chukwudi

Now, using Git and Github for personal projects where you’re the only contributor isn’t the same as when you’re using the workflow in a team. Another intern put it quite well.

I learnt more about git workflow today and how to avoid merge conflict. I also learnt how to work collaboratively with others on the same codebase without breaking the repository. I learnt how to use git merge tool to resolve conflicts on a merge. I have used git for 4 years now without having to learn this process. In these few days, I have been forced out of my comfort zone and learnt more about git, thereby preparing me for its professional use in a distributed and localized team. - Bytenaija

So yeah, it might have been relatively easy but even for someone with prior experience, there were lessons to be learned.

Oh, by the way, new signups for the internship have closed so if you wanted to take part then unfortunately for this year the ship has already sailed. However, join me on the journey here as I share my experiences of the going through the internship and what each stage challenged others and me to do.

Tweet me @Rayhatron with your thoughts about the HNG Internship. Does it sound like something you’d want to take part in when it comes around next year?