Linked Questions
146 questions linked to/from How can I specify a branch/tag when adding a Git submodule?
7 votes
2 answers
5k views
What is the difference between "git submodule foreach git pull origin master" and "git pull origin master --recurse-submodules"
I have a dotfiles repository where all my vim plugins are stored as submodules so they are easy to update when they have changes. I thought these two commands did the same thing, but I noticed this ...
7 votes
2 answers
5k views
Git - How to auto push changes in a directory to another branch
Complete question rewrite So I thought I was explaining this question very simply and direct but it seems I oversimplified to much, so here is all the extra details. Hopefully this helps everyone see ...
6 votes
1 answer
10k views
Is it possible to connect a git submodule to a specific commit on a branch on the main project?
I have this situation with git version 2.8.0.windows.1. I have one "release" branch of the main project and I push there everytime I've a new release. This project has a submodule that is developed ...
4 votes
3 answers
910 views
prevent some commit/code to be merged into master
For the project I am working on, we decided to develop a tool to help the development, so this is something that should not be in production. So I was wondering, as git is so awesome, if maybe there ...
4 votes
1 answer
6k views
Submodule - update .gitmodules for specifying a branch name
I have added a submodule to an ADO repository: .gitmodules [submodule "public"] path = public url = https://xyz.visualstudio.com/DefaultCollection/abc/_git/STW-Sol-public Is there a ...
8 votes
2 answers
5k views
Cannot checkout master branch from branch with submodule
I have a directory in my repo (call it blah) which contains some files that I manualy copied from another repo (repo-blah). One day, I decide to get smart and make this blah directory a submodule, so ...
3 votes
2 answers
8k views
How can I config git submodule branch in Jenkins?
In the "Additional Behaviours >> Advanced sub-modules" behaviours option, I can't see the submodule branch to select. Does it selects master by default or I can config branch in other way?
3 votes
2 answers
9k views
git submodule foreach checkout supermodule branch
Consider a git repository Foo/, which has submodules bar1/ and bar2/. Each of these has the same branches: 1 & 2. I enter the supermodule, and I want to update the supermodule to contain the ...
7 votes
2 answers
7k views
How can I do "git pull" in multithreading or efficient way? [duplicate]
I have one directory called 'projects' which is the parent directory, within that near by 200 sub-directories which are my projects. For now I am executting git pull by following script. #!/bin/bash ...
7 votes
1 answer
13k views
How can you peg a git submodule to a specific hash?
I have a project that has a submodule inside. I want to be able to clone the parent project with --recursive and get the submodule at a specific hash for that submodule. The specific hash is not the ...
9 votes
1 answer
12k views
How to specify a tag in gitmodules file?
I'm trying to setup a generic .gitmodules file to be used as a template for a certain static number of submodules new projects always require. Then use the technique shown in Restore git submodules ...
4 votes
3 answers
4k views
Rebase git submodule and parent repo
My situation: You have a feature branch based off master, and someone commits to master. Now your history is like this: A - B - C - D (master) \ E - F - G (feature) So you'd like ...
3 votes
2 answers
4k views
git submodule and "no branch"
Let's assume that we've got some git submodule in directory "submod". Now I'm doing such commands: # git submodule update --init submod # cd submod # git branch * (no branch) master If submodule ...
5 votes
1 answer
3k views
Pulling from a private submodule github repository using a deploy key?
I have a private github repository (Server) with another private repository (Shared) as a submodule. Since they're both set to private, and github doesn't allow sharing deploy keys - when I try to run ...
4 votes
2 answers
4k views
Git: How to share only selected folders and files from a repository to allow 2 teams to collaborate on it, but not share the whole code base?
They need to collaborate on one folder; they should not see the rest. They would need to be able to merge their changes into the main code base and get updates from that folder. This is all based on ...