Linked Questions
146 questions linked to/from How can I specify a branch/tag when adding a Git submodule?
3 votes
2 answers
8k views
git add submodule of only a certain branch
Is it possible to only checkout a single branch as a submodule WITHOUT the overhead of the whole repository in my main repositories working directory? (And really only download the files of that ...
9 votes
1 answer
3k views
Jar Dependencies in GitHub
I'm setting up a new Java project on GitHub, and I'll have some Apache Commons libraries as dependencies. What are the best practices to establish that my project needs those jar files? Should I ...
5 votes
1 answer
5k views
Can multiple Gitlab projects use the same Git repository?
I've been investigating moving from SVN to Git so that we can make use of Gitlab. One thing I'm not sure about though; Can we point multiple projects in Gitlab at a single repository? The ...
4 votes
1 answer
4k views
Git - Working with nested submodules?
I have the following git repositories Vector Random String String relies on Vector, and adds it as a submodule. Vector submodules Random. Random has no dependencies. Module: Random Module: Vector ...
2 votes
2 answers
2k views
git submodule: track 2 branches
Since a while (v1.8.2), git submodule allow us to track a specific branch: git submodule add -b <tracked_branch> <added_sobmodule> That's pretty useful in a use case where you use meta-...
2 votes
4 answers
2k views
git submodule checks out the same commit
After I git submodule update it always checks out the same commit. for example 34561. I do git checkout master for submodule and then git submodule sync. Then it points to the latest commit a2344. ...
3 votes
1 answer
5k views
Git submodule - How to keep the submodule updated when pulling from the main repo
We have the main git repository and one single git submodule. For this question, the main repository does only have a master branch, and the submodule does have two branches - X and Y. Let's say ...
1 vote
2 answers
4k views
Git Submodule has a wrong reference to its remote repository
I have two submodules in my main repository, both linked to two another remote repositories. When I enter the 1st submodule I am getting a message "HEAD detached at xxxxxxxx" - which is fine, cause ...
2 votes
1 answer
2k views
How do I pass a ROS package to another person?
I have made a ROS workspace and inside a package. I did catkin_make and everything is working well. I would like to give this package (or should I give the entire workspace?) to another person. I am ...
0 votes
2 answers
3k views
Why do I need to add the `--remote` to git's submodule when I specify the branch in the .gitmodule file?
I want to pull/update the submodules at the right branch. Doing git submodule update pulls/updates the submodules but it changes to the wrong branch even when the branch I want to ALWAYS use is ...
3 votes
1 answer
3k views
git submodule checkout latest commit of different branch from respective remotes
My parent project has a couple of submodules added to it. For deployment purposes, I want to checkout a specific branch eg master, staging, etc in each submodule and pull the latest commit of this ...
4 votes
1 answer
881 views
JGit: git submodule foreach command
I know the support for git submodules is limited in JGit, but still was wondering how can I achieve this: git submodule foreach git checkout <branchName> and similar commands using JGit. Or ...
1 vote
1 answer
3k views
How to structure a golang project with several go modules: a "core" module, and some "adapter" modules referencing the "core" one?
Hard to put in a single sentence, but here is the situation. I am developing a golang package, my intention is for it to be go-gettable. The core of the package provides some "central" ...
3 votes
3 answers
641 views
Git: how to clone another repository automatically after git clone
I need to automate the following step: git clone A && cd A && (git clone B; git clone C) I cannot use submodules. I cannot use a git wrapper (already existent or by writing some ...
4 votes
1 answer
893 views
How to list git submodules that have not been pushed to origin?
Sometimes I forget to push a git submodule. Is there a way to show which git submodules are ahead of origin, that have not been pushed?