DEV Community

Gerardo Enrique Arriaga Rendon
Gerardo Enrique Arriaga Rendon

Posted on

The Intricacies of Remote Repos

This week, it was time to work on another classmate's repo and contribute to their SSG, with more knowledge on how remote repos work.

I got the pleasure to work on an SSG created by Amasia Nalbandian (check her GitHub, too!). It wasn't by pure coincidence. After mentioning that nobody worked on my project a few weeks ago on the Slack channel for the OSD600/DPS909 students, Amasia decided to offer her help for the next time. As a way to thank her, I decided to work on hers. You can view the filed issue on her project here.

Setting the project

This week, cloning the repo went a little bit differently.

Normally, I would forked the project so I can have read and write access to the remote repo, and then cloned it into my local environment and start working with it.

However, our professor taught us about the concept of remote repos, and the intricacies behind it. He told us that, when forking a repo and cloning it locally, we have a reference to that remote repo, usually named origin. He also recommended that, if we forked the project, we should add another remote reference to the original remote repo, and call it upstream, for convenience.

Thus, I ended up having two remote repo references, origin, referencing mine, and upstream, referencing Amasia's GitHub repo.

The New Feature

This week, the feature to add was support for accepting configuration files, formatted as JSONs. These configuration files would accept some options that the command line interface also supports, such as input, lang, etc.

The first step was to figure out where to put the new feature. I asked Amasia some guidance, and she recommended me where to start reading the configuration file.

After that, I added the code I needed to read the file. It was very straightforward, since the project is in JavaScript, and I could use the integrated JSON parser to deal with the parsing of the file.

After finishing the feature, I committed the changes, push them to my fork, and submitted my PR.

Conclusion

While I didn't make use of the upstream remote reference in this lab, there are real purposes for this, such as testing another person's changes without merging.

Amasia has not accepted the changes yet. I will follow up and update this post when she does.

Top comments (0)