FAQ Database Discussion Community


Recursively cloning a git repo doesn't pull submodules

git,git-submodules
I'd like to clone a git repo [1], which has a submodule defined in .gitmodules: [submodule "PointInCircle"] path = PointInCircle url = https://github.com/midas-journal/midas-journal-843 Following these questions [2-4], I tried: $ git clone --recursive https://github.com/midas-journal/midas-journal-851 If I understand submodules correctly, which I obviously don't, there should be a directory inside midas-journal-851...

How to make a separate Eclipse project out of a subfolder under Git source-control

eclipse,git,git-submodules,subfolder,git-subtree
I have a website project with the main files in a root folder and an admin tool in a subfolder. The admin tool includes a few classes from the root folder. I would like to keep separate version control over the 'site' (root) and the 'admin tool' (subfolder) with Git....

git add submodule hash directly

git,git-submodules,git-add
Is there a way using git commands to directly update the submodule hash in the index? If not, is there a way to manually change it via modifying text somewhere in the .git directory? I want to point to a specific commit in a submodule, but I want to avoid...

git-svn workflow for an svn “super repository”

wordpress,git,git-svn,git-submodules,git-subtree
I'm trying to use Git to manage a WordPress installation. I'd like to be able to bring in various WordPress plugins as submodules and update them to specific tags as necessary. The problem is that all WordPress plugins are hosted in a single Subversion repository with over a million commits....

How to merge git submodules

git,git-submodules,git-merge
I have just done git merge in the app, I resolved many conflicts But when i do git status, i can see list of submodules with (new commits) in the message, it looks like the submodules (branch/tag) version have not been updated. For example: modified: plugins/myplugin.git (new commits) So, How...

what is the best way to deal with local dependencies on submodules in node?

node.js,git-submodules
In our environment we have a node app with a dependency on a submodule which is also a node module. We ran into issues using npm link so we tried using local dependencies (i.e. setting the value of the dependency in package.json to file:./path/to/dep). The problem with this is that...

How to update the git submodule?

git,git-submodules
I have 2 projects. "MyProg" and "SubProj". Both projects are on Bitbucket. One project is submodule to the second. The problem is that when I pull changes in the main project, the changes submodule are not pulled. Perhaps it should be, or did I do something wrong? How do I...

git submodules: Which repository shall be used as the 'submodule'?

git,git-submodules
I have a private git repository (repos 'private') with a bunch of files in them I frequently edit. Some of these files are published on a website. It is tedious to update these files every time I make a small change. I therefore thought of using git submodules in the...

Git submodules and orphaned commits

git,git-submodules
I have a git repo (A) where each commit is an orphaned commit with a name (branch). Git repo B consumes A as a submodule, and as such is always holding a reference to a SHA in A. When I make a fresh clone of B I need to do...

Git submodule without extra weight

git,github,git-submodules
I'm not a Git master yet, faced a problem I can't figure out how to fix. I have a repo with my WordPress custom skeleton and I've added WordPress as a submodule from its original repo by git submodule add wp_repo_url. When I clone my repo to local machine with:...

Git is slow on pushing submodules change to origin

git,git-submodules
I'm using git where I have a repo containing about 40 (!) submodule repos. Whenever I do a git git push origin master it's very slow on the remote: Processing changes action. Is there any way I can speed up the push? Gerrit is used as a backend but I'm...

Create a git tag with submodule

git,git-submodules
Small question about git submodule. Assume I have a projectA, and it have a submodule maybe called moduleA. Then I create a tag in projectA, tagA, then I may have some new commits for projectA or moduleA also, and then I want to go back to the tagA, using git...

Add git submodule as reference to existing solution in VS

git,visual-studio,git-submodules,projects-and-solutions
Lets say I have submodule repo: _git/DbModel (only source code indexed. No /bin or /obj folders) And two projects which needs DbModel as reference library: _git/TTT _git/TPM I've already add DbModel as submodule via GitBash to both of them git submodule add https://RepoPath/_git/DbModel And my local repos now look like...

Git submodules in TeamCity

git,maven,teamcity,git-submodules
It must be something obvious but I cannot get our project working in TeamCity v9; any ideas? jetbrains.buildServer.buildTriggers.vcs.git.submodules.MissingSubmoduleCommitException: Cannot find the commit b60595d378a27d38cb4ed397524a4c90cac627fc in the repository '[email protected]:/opt/git/cocoa-common.git' used as a submodule by the repository '[email protected]:/opt/git/ios.git' in the commit 1ce3d3b22f702b43254dea1f27d40382c562de37 at a path 'src/xcode/External/CocoaCommon' Another project using the same submodule gives...

How to change a submodule remote url locally having to commit back these changes

linux,windows,git,git-submodules
I have a project that should work under Windows and Linux. I put a central repository as folder on a server in our company. Next to it lies a repository which is a submodule of that repository. Now I can access this folder under Windows with something like \\server\project. Under...

How can I access only the branch name of a git submodule?

git,git-submodules
I have a submodule defined in .gitmodules as: [submodule "app/scripts/directives/foo"] path = app/scripts/directives/foo url = [email protected]:ross_rogers/foo.git branch = my_branch Is there a programmatic way to access this branch parameter from the containing repository? git submodule status produces (without newlines): 074d5c118eeae3bf622c6f878db96d8bf8b3bf47 \ app/scripts/directives/foo \ (heads/my_branch) I'm in a dual environment of...

Readable submodule status information in git

git,git-submodules
I have a script that checks out a repo, checks out the submodules, then prints some info about the submodules so that the user knows which tags/branches they are dealing with. The output on my own workstation looks like this: Entering 'SubModuleA', * feature/some_feature_branch, Branch is, feature/some_feature_branch, Tag is, undefined,...

git submodule checks out the same commit

git,git-submodules
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. But after update it again points to the commit 34561. How to change it? I...

Error 'invalid parameter include_src' when provisionning RabbitMQ with Puppet on Vagrant

rabbitmq,vagrant,puppet,git-submodules
I am trying to install the RabbitMQ module on my virtual machine. I used : git submodule add https://github.com/puppetlabs/puppetlabs-rabbitmq.git and I installed every dependecy I could find the same way (which are, like listed in this answer : stdlib, epel, staging and erlang). I reduced my manifest to the bare...

How to convert a GIT repo to a submodule, which is nested in another (parent) GIT repo?

git,version-control,repository,git-submodules,git-extensions
I have a GIT repo which has subfolders as GIT subrepositories. + main (local GIT repo) + subdirectory1 + plugin1 (created as local GIT repo) + plugin2 (created as local GIT repo) + subdirectory2 + subdirectory2a + plugin3 (created as local GIT repo) + subdirectory3 The plugin1, plugin2, plugin3 are...

Git submodule fail because of link to unexisting revision

git,github,git-submodules
I've got a problem with git submodules pull: I have two reporistories, let's call them repo A and repo B. Repo B is a submodule of repo A, so I added repo B as a submodule of A with this command line: git submodule add [email protected]:Aracthor/B.git libvvgl But when I...

git add . (dot) doesn't obey .gitignore (or my patterns are wrong)

asp.net-mvc,git,git-submodules,gitignore
I have the following situation. In my asp.net webforms projects, I have some shared repositories that I optionally use under my main repositories. The folders are named Shared and then Shared.* for others. For example, I have a folder structure like this. \main .. \\.git .. \main-subfolder .. \Shared (this...

heroku doesn't update submodules after push

git,heroku,git-submodules
I have an app hosted on heroku contaiting a submodule. The submodule contains multiple submodules. The submodules are in form of http address to github repo. app |- submodule1 |- other dirs submodule1 |- submodule2 |- submodule3 |- other dirs I made changes in several sobmodules then commited everything (including...

Changing an existing submodule's branch

git,git-submodules
When I initially added my submodule, I specified a particular branch, as seen in the .gitmodule file: [submodule "externals/grpc/grpc"] path = externals/grpc/grpc url = [email protected]:me/grpc.git branch = release-1.0 I want to change to the master branch of my submodule, so I changed the branch in .gitmodules from release-1.0 to master,...

Removing submodule and keeping files?

git,git-submodules
I am using a plugin that helped me tremendously but uses a submodule. When I tried to push it to remote I learned that a submodule is just a reference to another repo. I want to just have the files in my own repo and push them to remote. All...

Proper way to release in Git with submodules

git,github,bitbucket,git-submodules
Im starting to work with git submodules and Im a bit confused. Basically on my project I needed a modified version of hybridauth library. So I forked hybridauth, did my changes and added it as a submodule of my repo. Now when I try to do a release of my...

How to add files to main repository when using composer?

php,git,composer-php,git-submodules
In my PHP project I use composer. For some reasons (stupid, but it's not depending on me) I must store all project files in a git repository, including "vendor/" files fetched by composer. I've removed "vendor/" from the .gitignore file, but some modules (like https://github.com/RWOverdijk/AssetManager) are treated as submodules -...

git submodule has “new commits” when I checkout master

git,git-submodules
I have a submodule called Helpers. When I clone my main project with --recursive, the Helpers submodule is in a detached head state (as all of the tutorials say it should be). If I now 'git status' in the main project directory, everything is clean. If I 'cd Helpers; git...

How to organize source control for many subprojects? [duplicate]

git,git-submodules,atlassian-sourcetree,git-subtree
This question already has an answer here: Detach subdirectory into separate Git repository 17 answers I am creating a website with web apps within it. I am now at the stage where I am using phonegap to turn the web apps into mobile apps, but for that I need...

git trying to clone a submodule's ref that doesn't exist

git,git-submodules
I'm trying to clone a project with submodules, and I get a message like this one: fatal: reference is not a tree: da3d99e1e6c554231cba76066a7b3149592e597e Unable to checkout 'da3d99e1e6c554231cba76066a7b3149592e597e' in submodule path 'module_path' Now, I'm not a first timer with git modules, and first I checked if the co-worker who pushed the...

How to migrate only a part (subset, folder) of one Git repository to another

git,git-submodules,git-subtree
I have a bitbucket repo A that I've been using for development. The production code is only a subset of the code on bitbucket repo. I want to continue using repo A for development and migrate only the production code subset to repo B. Is this possible? i.e. Source repository...

My project uses over 100 git submodules, which submodule alternative can handle a lot of repositories gracefully

git,dependencies,repository,workflow,git-submodules
I've been researching git subtree and other alternatives to git submodules. My project has well over 100 submodules and it's very unwieldy to manage them all. Can anyone recommend a workflow that works really well with a large number of repositories that need to be kept in sync....

How to add an existing nested repo (already checked out in a subdir) to a parent Git repo as a submodule?

git,git-submodules,git-add,git-init
What happens if I'm creating the initial commit from my working (parent) directory, but there are subdirs with independently checked-out git repos? I simply did git add . but that brought me to a strange situation when the subdirs with nested Git repos are not registered as submodules of the...

How do I squash all commits without losing submodules?

git,git-submodules
I like the answers from Squash all Git commits into a single commit. However, I get merge conflicts if I: git rebase --root -i with pick and squash as suggested. And, I lose my submodules (I have 5), when I rm -rf .git git init git add . What is...

How to integrate build output from one git repo into another

git,git-submodules,git-subtree
I am working on a 2 projects which are stored in 2 git repos Project1 and Project2 Project1 is a javascript project. It has its own repo (for example https://github.com/gandra/project1.git) Project2 is a java maven project. It has its own repo (for example https://github.com/gandra/project2.git) Here is a current workflow which...