So we finally have git set up but I’m really confused how to handle multiple people merging.
I have a branch, test, that I merged a feature in to earlier today. The other developer has now merged his new feature into test, and in the process – since his new feature was branched off before I merged mine in – it deleted the files that mine added.
1) How do we get around this?
2) How can I force git to not remove or overwrite files without asking?
Edit: Corollary: When should we pull, and I guess when we pull (I’m guessing before a merge?) we should merge the pulled copy into the branched feature?
There’s something very very wrong there. Files do not just get deleted from a branch, Git will always tell you if there are conflicts and that happens by default. If they were committed correctly they will still be recoverable.
You need to make sure the other developer knows what he’s doing when he’s performing a merge. If things are exactly like you describe, it sounds like he put considerable effort into merging his feature at the cost of not having to deal with a merge correctly, meaning he chose to remove your earlier changes.
When you pull Git merges automatically and warns of any merge conflicts. If you want to avoid merging automatically, perform a git fetch and then rebase your branch.