2

So I have a project A with a third party dependency B which lives on some other server.

If I add B as a submodule of A, then I can easily get the third party changes to B using the standard submodule workflow. Furthermore, I can clone A to another machine and have B in the exact state that I'd expect.

If I add B as a submodule of A and make my own set of changes and commits to B, I can still get third party updates to B. However, if I try to clone A to another machine, B will end up in a bad state since the commits I made to B aren't 'public'.

What's a good workflow to accomplish this second scenario? Namely, being able to use, modify, and update third party submodules from a repository without sacrificing the distributed nature of git?

1 Answer 1

4

Fork B. Include your fork as a submodule of A. Pulling upstream changes is then a two step process; pull the change from B into your fork, update your submodule in A.

This also assumes that your fork repository will be accessible to whatever other machine you want to checkout A on.

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

Comments

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.