Using different protocols for "pull" and "push".

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Using different protocols for "pull" and "push".

From: Nikos Chantziaras <hidden>
Date: 2016-06-15 22:46:54

Hi.

I wonder if it's possible to setup Git (probably in .git/config) to use 
SSH only for "git push" and use the git protocol for "git pull".  My 
current configuration is:

[remote "origin"]
         url = ssh://user@project.someserver.net/gitroot/project
         fetch = +refs/heads/*:refs/remotes/origin/*

Issuing a "git pull" command results in pulling using SSH (along with 
asking for a password).  Is there a way to alter the configuration so 
that a "pull" will use git:// instead of ssh:// ?

Re: Using different protocols for "pull" and "push".

From: Mike Gaffney <hidden>
Date: 2016-06-15 22:46:54

I typically set up a "push" remote when I need to do things like this. 
I've got a few projects where I get confused of which one is origin so I 
protect myself from pushing accidentally (I have to think for a second 
when pushing).

-Mike

Nikos Chantziaras wrote:
Hi.

I wonder if it's possible to setup Git (probably in .git/config) to 
use SSH only for "git push" and use the git protocol for "git pull".  
My current configuration is:

[remote "origin"]
        url = ssh://user@project.someserver.net/gitroot/project
        fetch = +refs/heads/*:refs/remotes/origin/*

Issuing a "git pull" command results in pulling using SSH (along with 
asking for a password).  Is there a way to alter the configuration so 
that a "pull" will use git:// instead of ssh:// ?

-- 
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help