Linked Questions
146 questions linked to/from How can I specify a branch/tag when adding a Git submodule?
0 votes
0 answers
952 views
Why my Git submodule is automatically detached HEAD to a specific commit? [duplicate]
I have a parent repository named 'A' that contain a submodule 'B' When I clone 'A' i got 'B' detached HEAD to a specific commit. My clone command is: git clone --recurse-submodules https://github....
1 vote
1 answer
669 views
Bind a specific git submodule branch to a specific main repo branch [duplicate]
I am trying to automate a recurring workplace scenario. I have a repo myRepo which contains a submodule mySub. I create a new branch for myRepo called myRepoBranch and also a new branch for mySub ...
4743 votes
43 answers
2.0m views
How do I remove a submodule?
How do I remove a Git submodule? Why can't I do git submodule rm module_name?
1080 votes
6 answers
405k views
Definition of "downstream" and "upstream"
I've started playing with Git and have come across the terms "upstream" and "downstream". I've seen these before but never understood them fully. What do these terms mean in the context of SCMs (...
503 votes
16 answers
411k views
Why did my Git repo enter a detached HEAD state?
I ended up with a detached head today, the same problem as described in: git push says everything up-to-date even though I have local changes As far as I know I didn't do anything out of the ordinary,...
270 votes
9 answers
214k views
Why is my Git Submodule HEAD detached from master?
I am using Git submodules. After pulling changes from server, many times my submodule head gets detached from master branch. Why does it happen? I have to always do: git branch git checkout master ...
247 votes
2 answers
314k views
How do I check out a specific version of a submodule using 'git submodule'?
How would I go about adding a Git submodule for a specific tag or commit?
190 votes
1 answer
165k views
git submodule tracking latest
We are moving our (huge) project to git and we are thinking about using submodules. Our plan is to have three different heads in the superproject: release, stable, latest The project leads will ...
202 votes
3 answers
100k views
SVN:externals equivalent in Git?
I have two SVN projects in use from another SVN repository using svn:externals. How can I have the same repository layout structure in Git?
108 votes
4 answers
67k views
Force Git submodules to always stay current
I love git submodules. Also, I hate git submodules. What I love about them is how it enables to you to cleanly compartmentalize dependencies etc. I get the point of having them point to a specific ...
30 votes
3 answers
51k views
'git checkout' docs claim working tree will change; why are edits not discarded?
I am new to Git and trying to wrap my head around the way branches work. According to the documentation, git checkout: Updates files in the working tree to match the version in the index or the ...
40 votes
5 answers
33k views
Git submodule is in "detached head" state after cloning and submodule update
When I clone my git repo, one of the submodules is in a branch with a strange name, which I think means it has a "detached head" (I'm not even sure what that means). If I checkout my main branch for ...
43 votes
7 answers
14k views
How to use submodules publicly, but symlinks to a single clone locally?
I'm having my first Git Submodule experience. I have some projects that depend on the same subproject. I keep these projects in sync, so I'm using the "submodule branch" feature (e.g. git submodule ...
31 votes
1 answer
19k views
How to move Git submodule to sub-directory? [duplicate]
guys, I just used submodule to organize some Git repos, here's the address: repos I want to move all the submodule into a new directory called repos, for examples, jquery -> repos/jquery. I change ...
12 votes
3 answers
27k views
How to have different branches in different folders in git?
I have recently created a repository. I made two branches in it, master and dev. Now when I copy files in the repositry's directory then the files are added to both the branches. But I only want to ...