DEV Community

Yuan-Hsi Lee
Yuan-Hsi Lee

Posted on

Git Remote

Two weeks ago, we had practice with sending pull requests to contribute to other classmates' repo. This week, our goal is to use git remote instead.

It took me a while to understand the concept of git remote. Basically, git remote provides a safe way to work as a team. I can work on another person's reop by forking it to an independent repo which won't affect this upstream repo; at the same time, I can always update the new changes that are pushed in the upstream repo by fetching/pulling. If the upstream repo author likes the changes I made in my forked, origin repo, she can also pull and merge my repo. The two repos are separate but still have connections. Git remote is great for teamwork since everyone can have her own forked repo and work on the assigned parts without affecting other people's work.

In this practice, I team up with my old C# partner again. We worked on each other's repo and fetch those changes. The feeling of working on other people's code is always interesting. You need to read each line of code in detail and try to follow her/his coding style and design. Even though we've collaborated before, and the feature that we're working on is the same one, the way we code are still different. This is the best thing about collaboration, I can always find a new possibility in the same, old thing.

The process of using git remote to merge my partner's code is smooth, with no merging conflict to fix. Oddly, I am a bit sad about that. Last time I made mistakes about switching between different branches. To solve the issue, I did research and ask my professor for help, and did more research after. I learned a lot through that process. It is always best to learn from the mistake, you'll be pushed way harder in order to solve the issue.

Top comments (1)

Collapse
 
slimdestro profile image
D\sTro • Edited

Nice 👌 its little tough if whole team is working on one central repo. Even we create branches and then generate PR but merging is like a common term. Earlier I suggested a trick like putting 2-3 more enters if some other developer has to change same line of code because git merge with fast forward compares data against line. Unfortunately still conflict occurs sometimes 😀