New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Checkout branch with different submodules is not working #3065
Comments
I think you describe Git issue, not GitExt |
I don't think so. |
Calling it at each checkout it's too time consuming |
Yes, it's time consuming. Nevertheless it is the only way to grant project consistency. I think having consistent checkout has higher priority than operation time |
I am running to a similar issue/feature need. Only thing that seems to be shared across branches is the
and that allowed to leave the submodule info in the config file but only process it if the active branch lists/includes it. Speaking very hypothetically here, what about copying the config file into the repo (so each branch has it's own version) and you soft-link that to the original file (had to be done after every clone), would that work? |
Abandoning this because of age and lack of discussion. |
More over, there is no need to
So the subset of commands |
The .gitmodules file does provide a purpose. It is how the sync command works. https://git-scm.com/docs/git-submodule#Documentation/git-submodule.txt-sync--recursive--ltpathgt82308203 |
That is not complete information, there is another ways exists: #10642 |
.gitmodules is a template source for urls and is modified when you add/alter submodules. It is included in the repo so when you push to a remote and someone pulls down they get the same submodule info. Think of .gitmodules as the original and config as your working copy definition. sync puts you back to same as original(.gitmodules). So please stop compaining about a standard and well known git feature in this repo and instead if you have desires to aler git itself... go there. |
On the active note. That will just work because git will understand it. Since we just call submodule update --init.. So if you configured active.... That command would respect the active config rule mentioned. Active submodule info |
I am not. This is just a fact. The |
So show us the problem in GE. Provide a sample repo we can pull and show what you expect vs what you get. I would stop in this issue and post a clear and well defined issue. I see you created #10642 So post the details and what you expect vs what you get to help us see the issue in that issue. |
Pretend you have a project with 3 submodules: bee, zebra, lion
Create a new branch
alpha
and checkout it.Remove zebra by running
git submodule deinit zebra
That will empty the
zebra
directory (but not the directory itself) and remove the related section from.git/config
.To actually drop the entire submodule complete the operation with
git rm zebra
It wiil delete the directory
zebra
and modify.gitmodules
Now the submodule is gone. Commit the modifications.
To properly checkout
master
you should, essentiallygit submodule deinit .
git checkout master
git submodule update --init --recursive
To go back to
alpha
, againgit submodule deinit .
git checkout alpha
git submodule update --init --recursive
If you don't run the first command
deinit
,alpha
will containzebra
while it shouldn't!The text was updated successfully, but these errors were encountered: