Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GIT Submodules in VSTS online?

I have a VSTS project with a git repo. The repo has some submodules that are also required as part of the software projects development.

Is there a way to create submodules inside the same VSTS project? The other option would be to split the development tasks between a VSTS project for the submodule and the project using the submodule which isn't ideal as there's a lot of overlap between the two as far as devleopment goes.

like image 212
meds Avatar asked Dec 03 '17 12:12

meds


People also ask

Is using Git submodules a good idea?

Git submodules may look powerful or cool upfront, but for all the reasons above it is a bad idea to share code using submodules, especially when the code changes frequently. It will be much worse when you have more and more developers working on the same repos.

How do I manage Git submodules?

Use the git submodule update command to set the submodules to the commit specified by the main repository. This means that if you pull in new changes into the submodules, you need to create a new commit in your main repository in order to track the updates of the nested submodules.

Do I need Git submodules?

Git submodules allow you to keep a git repository as a subdirectory of another git repository. Git submodules are simply a reference to another repository at a particular snapshot in time. Git submodules enable a Git repository to incorporate and track version history of external code.


1 Answers

You can add multiple Git repositories to your VSTS Project. And you can push a repository that references another through submodules.

In the Code hub, expand the repository and click New Repository:

enter image description here

Use the second repository to store your submodules and reference it from the first repo. The submodule setup all happens locally on your local git repository, use whatever tool you prefer or the command-line and then push the repositories to VSTS.

like image 77
jessehouwing Avatar answered Oct 31 '22 12:10

jessehouwing