Sharing and Merging Code

During a group project at university, we needed to develop a web application. We were seven on the project and there was a lot of work to do. Thus, we decided to split the amount of work between the members. In order to share our code in the group we used a specific software called Source Tree. People were updating the general code branch when they finished their own code by adding it. But we faced a problem: the general code was never the same and errors appeared when different parts were merged. We discovered that this problem came from the fact that people were changing the general code at the same time. Thus, we established a rule, before modifying the general code, the person had to warn the group she is remoting the code and then let them now when it is over. And this allow us to have a common code without errors.

Comments

I think the usual solution is to always pull the code right before pushing. If you consistently (!) run into the problem of modifying the same file, you might consider modularizing your code more if possible. If it only happens occasionally, bite the bullet and resolve the merge conflicts manually. Nonetheless, if the solution worked for your group, that's all that matters in the end.
Klaus Nigsch - Sun, 11/25/2018 - 12:17 :::
Hi, an interesting solution! However I would like to know if there was any reason for you not to use GiT from beginning on? There are numerous solutions already in Internet concerning exactly these issues.
Daria Piacun - Mon, 12/10/2018 - 09:14 :::
4 answers

I have been in similiar situations really often during my Bachelors (always fighting with different software plaftorms for sharing code - at the beginning of Bachelors, though - as we were not so advanced).
I was (like every other student) then introduced with the GIT and this is the thing that I would highly recommend!
If you, however, happen to have some merging problems, then just try using one of the following commands:
git fetch origin
git reset --hard origin/master

Good luck!

I'm not sure if it works the same way in SourceTree but in Git, you can create a merge request when you commit new content, and assign someone to resolve any conflicts. It might also be better if the same person is responsible to deal with merge requests (since it is a small project) to avoid confusion and unauthorized merges.

Taggings:

Hi, an interesting solution! However I would like to know if there was any reason for you not to use GiT from beginning on? There are numerous solutions already in Internet concerning exactly these issues.

Taggings: