Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git Submodule update over https

I am sitting on a proxy which only allows http/https traffic only, I am able to clone a repository from Github, but I have to fetch/push using the https URL and username/password.

Now my issues is a repository with submodules, when I execute git submodule update it times out, and I can only assume this is because it's using an SSH connection which is blocked. (it doesn't even ask me for a password on private repos)

like image 406
Dunhamzzz Avatar asked Jul 10 '12 09:07

Dunhamzzz


People also ask

How do I update my submodule remote?

In order to update an existing Git submodule, you need to execute the “git submodule update” with the “–remote” and the “–merge” option. Using the “–remote” command, you will be able to update your existing Git submodules without having to run “git pull” commands in each submodule of your project.

Do submodules automatically update?

Submodules are very static and only track specific commits. Submodules do not track git refs or branches and are not automatically updated when the host repository is updated.

How do I sync submodule?

git submodule sync synchronizes all submodules while git submodule sync -- A synchronizes submodule "A" only. If --recursive is specified, this command will recurse into the registered submodules, and sync any nested submodules within.


1 Answers

Edit your .gitmodules file with the https url, for example:

[submodule "vendor/engines/fat_free_crm"]     path = vendor/engines/fat_free_crm     url = https://github.com/fatfreecrm/fat_free_crm.git 

Then run git submodule sync to reflect the change to your .git/config file.

Credits: https://stackoverflow.com/a/6632693/1273077

like image 161
fkoessler Avatar answered Sep 29 '22 23:09

fkoessler