We have two different repositories on Git which need to come together to form the solution in Visual Studio.
Files under each project may be from the two different repositories. I need to make sure that when I make changes, it updates the changes in the correct repository (that is, the other repository should not perceive it at all) and also give me an option to add new files to a specific repository.
How can this be achieved, if can be done at all?
With Git, using multiple repositories is the only way to work efficiently. This enables each team to work independently, and do their work faster. You can also make sure that developers only have access to the repositories they need access to (thus making Git more secure.)
You can use submodules to realize it. Treat one repository as mainRepo and the other as subRepo.
git submodule add subRepo’s_URL
git commit –a –m ‘input your comment’
, and then modified files from mainRepo can be committedcd [subRepoFolderName]
), you can also use git commit –a –m ‘input your comment’
, so modified files from subRepo can be committed.This may be different from want you thought, but it really saves you from which is the correct repository you want to update the changes in.
For more details about submodules, you can refer to here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With