git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: How to push using SSH and pull using HTTPS for all repos on GitHub?

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Aug 5, 2018, 03:28 UTC
Message-ID
<20180805032854.GG258270@aiede.svl.corp.google.com>
In-Reply-To
<CAH8yC8nagnHtEosS0zNuHyh04GZYqfmL_5eR_R2qkWEBpxcM=w@mail.gmail.com>
Jeffrey Walton wrote:
> On Sat, Aug 4, 2018 at 9:26 PM, Jonathan Nieder <jrnieder@gmail.com> wrote:
>> Jeffrey Walton wrote:
>>> I'm having trouble setting up my ~/.gitconfig to push using SSH and
>>> pull using HTTPS for all repos on GitHub. The idea is, no passwords on
>>> pulls and only use the password for push.
[...]
Show 8 quoted lines
>>>    [url "ssh://git@github.com/"]
>>>        insteadOf = https://github.com/
>>
>> Does putting pushInsteadOf here work?
>
> Yes, that was the trick.
>
> Thank you very much.
You're welcome.

I should have asked: do you remember where you first looked for this answer in documentation? Maybe we can improve it.

A few thoughts:
 1. git-push(1) could get a CONFIGURATION section.
 2. the description of url.*.insteadOf in git-config(1) could mention
    pushInsteadOf.  The description of url.*.pushInstead is right
    after it today, but there is nothing guaranteeing that that will
    continue to be true.
 3. Likewise, the description of remote.<name>.push could include a
    pointer.
 4. Maybe there's a place to put some thoughts on this in the
    user-manual, too.  It already mentions remote.<name>.push.
What do you think?

Thanks, Jonathan

Previous: Jeffrey Walton
Message 4 of 4 in “How to push using SSH and pull using HTTPS for all repos on GitHub?”
  1. Jeffrey WaltonAug 4, 2018
  2. Jonathan NiederAug 5, 2018
  3. Jeffrey WaltonAug 5, 2018
  4. Jonathan NiederAug 5, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.