I'm very new to Git, and I'm trying to understand the workflow of it. I've come to a situation where I don't know how to accomplish what I want to do, and would be glad for someone to explain WHAT is happening and more importantly WHY.
The scenario is this: I'm working on a project with another person. The project consists of different independent sub-projects. The idea is that we will work on the different sub-projects on our own and gradually add the results of these sub-projects into the main project.
To manage this we've created a shared repository on GitHub containing information A. We both clone that repository to out local computers. I locally create a new branch for working on sub-project B and he does the same for sub-project C. In the end we want only one branch on GitHub containing all the information A+B+C.
What are the different ways to accomplish this? The thing I can't get my head around is how I can push my work B into GitHub without making any changes (like removing) his work C that he has already put there. What happens if he locally merges A and C into A+C, pushes that to GitHub, and I then do the same for A+B; what happens then to the C on GitHub? Is it better to find a way to push our separate branches for B and C onto GitHub, and there merge A, B and C into A+B+C?
As you can tell I'm a bit confused by this, and would appreciate some help.