2

Everytime I make changes in the submodule, git registers the new commit in my original project

enter image description here

This causes loads of conflicts between different team members. How can this be prevented?

0

1 Answer 1

4

You cannot simply prevent this. The commit hash of for your submodule is stored in a file, so if you change that commit hash in two branches of your super-project, then you will inevitably have a merge conflict.

If you need to change the submodule for every commit however, then maybe your submodule shouldn't have been a submodule in the first place. You can look here on how to merge a submodule into the parent tree.

Also: take a look here on how to manage conflicts with submodules.

Sign up to request clarification or add additional context in comments.

2 Comments

Cant that file be added to git-ignore somehow?
Adding to git-ignore is pointless, the point of a submodule is the SHARE code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.