Reputation: 857
I'm trying to setup a git deploy setup, wherein I push my changes when ready to a git repo on a staging server, that then uses a post-recieve hook to deploy the code from the various branches to the appropriate web roots.
A problem I've encountered however is every time I run: git submodule update
I receive a password prompt, causing the deploy script to freeze up.
So far the things I've tried are:
One thing to note is when setting up the repo on my staging server, I wasn't able to just clone the repo from my working instance due to firewall restrictions, so I instead cloned a copy locally then moved that newly cloned version to the server, and I've been able to push to it just fine.
Looking for any advice or tips I can get.
Upvotes: 19
Views: 24556
Reputation: 131
Change https://..
to git@...
in .gitsubmodule
for the url
parameter, then run command:
git submodule sync --recursive
Upvotes: 12
Reputation: 674
If you can't replace the https://
with git@
, you have the option to simply setup the password in your
~/.netrc
file. Here the format:
machine githostname.com
login yourgitusername
password yourgitpassword
Upvotes: 2
Reputation: 1
When supplying url's for submodules, you can either use a local file path or a url.
If you supply a url, try using something like: "[email protected]:myOrg/myRepo.git"
This allows system git to use the appropriate user to access the repo, if you're using the https://username@... then another user will have to supply the credentials needed to access the repo, or yourself if you haven't set up git with a user.
Upvotes: 0
Reputation: 25141
Had the same issue. In my case it was caused by setting the submodule "url" to the https
URL instead of the git@
URL.
Upvotes: 24