DEV Community

Cover image for Learning more about Git Merges and Remotes
Bregwin Jogi
Bregwin Jogi

Posted on • Updated on

Learning more about Git Merges and Remotes

This week, I was assigned the task of adding a new feature to another student's repository for our open-source class. Since we are all working on console applications, the repetitive nature of entering the same commands over and over can get a bit tedious. To tackle this, I was asked to implement a feature that allows users to specify default commands in a TOML file, making the process more efficient.

For this task, I worked with Cleo’s project, genereadme, which generates README files for specified documents. My first step was to fork the repo and create a new feature branch. I made a draft pull requests because it shows that I’ve started working on an issue, and they give the repo owner a chance to make suggestions while I’m still developing the feature.

The feature I implemented involved reading a configuration file from the home directory. If users provide command-line arguments for the same options, those would override the defaults specified in the TOML file. After completing the feature, I submitted my pull request. Cleo reviewed it and gave me some helpful feedback, suggesting I move the feature to a different folder and simplify the function. I made those changes and finalized the pull request.

Image description

The code was merged after all the suggestions were addressed.

In the meantime, another colleague Vinh developed the feature for my own repo, he first made an issue on the repo to ask if he can add the feature, to which I said Yes! He then started working developing the feature and once it was completed, he made a pull request. In the PR, he explained exactly what he implemented and even added helpful comments in the function he created. I tested the code by adding a git remote of his issue branch.

Image description

I was pretty happy with how it was implemented, and the app ran perfectly. Since I didn't have any additional suggestions, I merged his code to the main branch.

Overall, it was a fun experience, and I’m sure this feature will come in handy as I continue working on open-source projects in the coming weeks. It also reminded me of how valuable feedback can be when working on a project.

Top comments (0)