-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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
Git submodule support #7829
Comments
@joaomoreno Any news or comments about this? Right now Code beats Atom, Brackets and Sublime in speed(except for Sublime), git integration, usability and lots of other stuff, but the lack of support for git modules renders it unusable for my team. |
Nothing. |
Hey, Looks like I just solved this problem with a little experimentation. I'm using VS Code and could resolve all of my merge conflicts, except one file wouldn't open and just said "Can't Open This Git Resource". This was a new file I was merging into master from another branch, so it wasn't that it was a conflict but it just didn't exist on the other branch. I went ahead and staged the change then synced and it worked fine. |
Seconding sub-module support. VSCode is great otherwise but would love to see diffed files from included submodules (and even ability to push). |
Also want to request this feature. Had to disable Git support in VS Code because I need this in most of my projects, without it the Git support is useless. |
+1 for submodule support. |
+1 as well, it doesn't seem like Code can see node.js packages if they are in the submodule's root. (I am using TypeScript). |
+1 much needed for any large size project |
+1 It's a really needed feature. Is there any chance we will see it near future? |
+1 For most cases, this would make dedicated Git GUI Clients redundant when using Vs Code |
How does this interact with the newly proposed SCM API in #2824 ? I also use git submodules a lot and have to rely on an external tool or multiple VSCode windows, which is a pain. |
+1 |
This feature is a basic usage of git, i really don't understand why the project maintainers haven't yet implemented it. Maybe they don't use anymore VSCode at work? |
@antoine-pous Feel free to provide a pr. :) |
+1 for submodule support |
+1 we need submodule support :) |
+1 |
1 similar comment
+1 |
Please use GitHub's "+1" reaction for the first post instead of posting +1. |
I'm really confused that it's not supported yet. |
+1 |
So, for those of you who are requesting this, what does git submodule support look like? I've never used it much, but have started, so I was thinking of trying to implement it here. |
Inside a project, particularly one versioned with Git, you have add 'submodules', which are direct links to additional Git repositories. One may be using such a repository, as a dependency within their own project. You may also be a contributor to said submodule. When you open a project in VS Code, it shows you the Git versioning for the current project you have opened. From there you can view your change history, make commits, etc. Often, you do development within your submodules too. Ideally, you would be able to change to that submodules directory, and view the change history make commits, etc. Currently there is no support for doing so. |
@erickarr, so would automatically opening submodules similar to the way multiple git repositories are opened when you open a folder above them satisfy the need, for the most part? You still have to context shift to perform operations on these separate repositories, but you don't have to leave the editor? |
@petkahl Yes, exactly. As people have mentioned previously, currently when you click on the folder to open it, you get a 'Unable to open 'Specified Folder Name': File is a directory' error. It would be awesome, to click on your submodules folder name, jump in there, make your commits etc., and jump back out. Because the developers have truly done a good job with the Git integration in VS code (compared to many alternatives), but the ability to do the same within submodules is missing. |
You're talking about the folder name in the source control context, not the Explorer, right?
I like the idea of submodules having a sort of tree structure, and when you're in a submodule, show a ".." submodule that is actually the parent. But as far as I can tell, there's no way to open a particular repository programmatically. |
If anybody's interested, https://github.com/petkahl/vscode/tree/git-submodules contains the first pass at my first bullet point above. I'm going to see if I can address the second one, at least, before I make it a pull request. |
+1 |
This can technically be done with a new feature introduced, multi-root workspaces. Just add folders including sub-modules to the workspace (File -> Add Folder to Wordspace...) and both repositories should appear on the source control menu. |
@johnnyhuy Awesome, gonna test this |
@johnnyhuy Multi-root Workspaces doesn't fix this. In projects with git submodules, details of the submodules don't show on the Source Control pane. It treats the submodule as a file. This is a must-have for any project that uses git submodules. |
What's interesting is, when trying to use Multi-Root workspaces as a workaround, it is very significant what order you add the folders. In my experience, if you add the submodules first, then they show up in the source control pane, but if you add the parent folder, it never shows up. If you add the parent first, it shows up, but none of the submodules ever show up, probably because of the way it searches for repositories. #36313 is a pretty solid fix for this, hopefully it'll work its way through the process and get included. |
git subtree is better than git submodule. Would it be possible to add the |
subtree is maybe better for you - but not for all. |
Thanks to @petkahl (#36313), basic submodule support has landed in A bit more details:
We still need submodule management features (add, remove, update, init), but since the basic support is in, I'll close this and wait for feature requests! |
How can I use it? |
@ultra2, it just makes the submodule git repositories show in the source control sidebar (and highlighting in the file explorer). You still have to manage the submodule creation and init from the command line. |
@ultra2 the problem that it actually does not. I have several git repos with submodules, and I do not see behavior similar to a GIF above. while Sourcetree recognizes the submodule and allow to work with it as a repo, vscode does not do that. It does not mark submodule with 'S' in explorer, it tries to update submodule's root folder and fails with an error |
It's available on 1.20.0-insider. |
1.2.1
Windows 8.1 x64
Steps to Reproduce:
Is there support for this handy git feature?
The text was updated successfully, but these errors were encountered: