DEV Community

Abdulbasid Guled
Abdulbasid Guled

Posted on

Lab #3: Why make PRs when you can just merge everything together!

At least, it should appear that way.

Anyway, for our third lab, we were required to add 2 new features to our release 0.1 code. This was to get us practicing and learning how to merge branches around and dealing with merge conflicts. The two options I opted for are the following:

The features themselves weren't too difficult to create. Just needed to rewrite some functions I wrote previously to account for the potential json format option.

Time to merge. Well, sorta. See, I didn't do any readings on git merge prior so when I just tried to do it, it said that both of my branches were equal with the master branch. This confused me as I was positive that wasn't the case. However, after talking with my professor about this, I realized I made a mistake in not committing to the local branches that I had made. I had uncommitted changes, which meant that as far as git knows, they were on the same level. I went about rectifying this and thankfully, everything was working as intended. I merged the first issue just fine, and had merge conflicts with the second branch as was expected. I fixed the conflicts, then committed to my master branch, followed by my remote repo.

Any person that works with open-source or anything related to github will have to eventually deal with merge conflicts. It's a natural part of the software development life cycle. This lab made me learn about this the hard way. It's a valuable experience that I'll learn to keep with me for the rest of my coding career.

By the way, the resolved commits can be found below:

Now to go play some Genshin Impact, cause what better way to celebrate finishing this week's open-source material is to play a newly released gacha game. Pray for my wallet, everyone!

Stay tuned!

Top comments (0)