different push/pull urls for git submodule -


i'm using git superproject pattern in large project deployed teamcity build agent not have repository account, repository set allow anonymous cloning. reason have set submodules http:// url rather git url. issue repository rejects http pushes:

total 0 (delta 0), reused 0 (delta 0) error: rpc failed; result=22, http code = 401 fatal: remote end hung unexpectedly fatal: remote end hung unexpectedly 

so every time update submodules when switching branches, have git remote add-url --push add git:// url.

is there way set submodules in superproject such use http:// url pulling , git:// url pushing?

the libreoffice project uses submodules , includes:

by default submodules repository in state called 'detached head' means commit checked-out -- 1 super-project (core) need -- not associated local branch name.

don't forget add correct pushurl submodule working on or not able commit.

$ editor .git/modules/submodule/config 

and in section [remote "origin"] add:

pushurl = ssh://logerrit/submodule 

(similar soulseekah's comment) (in case, use git:// address)

you can through (within submodule)

git config remote.origin.pushurl git://... 

if don't, illulstrated in this project, a:

fatal: remote end hung unexpectedly 

Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -