{"thread":{"id":"49038","subject":"How to push using SSH and pull using HTTPS for all repos on GitHub?","startedAt":"2018-08-04T23:16:13Z","lastAt":"2018-08-05T03:28:59Z","messageCount":4,"participants":["Jeffrey Walton","Jonathan Nieder"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"354510","messageId":"CAH8yC8mXaNDmLBpDmtVTP+6Yc8_fCz8YCadOL41fOvb2J6j=8Q@mail.gmail.com","threadId":"49038","inReplyTo":null,"subject":"How to push using SSH and pull using HTTPS for all repos on GitHub?","fromName":"Jeffrey Walton","fromEmail":"noloader@gmail.com","sentAt":"2018-08-04T23:16:10Z","receivedAt":"2018-08-04T23:16:13Z","isPatch":false,"sender":{"key":"noloader@gmail.com","avatar":null},"body":"I'm having trouble setting up my ~/.gitconfig to push using SSH and\npull using HTTPS for all repos on GitHub. The idea is, no passwords on\npulls and only use the password for push.\n\nI've got the first part of the equation using the following in my\n~/.gitconfig (the ellipses are user info):\n\n   $ cat ~/.gitconfig\n   ...\n   # Enforce SSH\n   [url \"ssh://git@github.com/\"]\n       insteadOf = https://github.com/\n   [push]\n      default = current\n\nThe above pushes and pulls using SSH. Pulls only need HTTPS so I tried\nadding the following which does not work as expected:\n\n    [pull \"https://github.com/\"]\n\nI've found several ways to break Git when trying to setup the HTTPS pull.\n\nMy question is, how do I setup the HTTPS pull in my ~/.gitconfig?\n\nThanks in advance.\n"},{"id":"354512","messageId":"20180805012602.GB258270@aiede.svl.corp.google.com","threadId":"49038","inReplyTo":"CAH8yC8mXaNDmLBpDmtVTP+6Yc8_fCz8YCadOL41fOvb2J6j=8Q@mail.gmail.com","subject":"Re: How to push using SSH and pull using HTTPS for all repos on GitHub?","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2018-08-05T01:26:02Z","receivedAt":"2018-08-05T01:26:07Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Hi,\n\nJeffrey Walton wrote:\n\n> I'm having trouble setting up my ~/.gitconfig to push using SSH and\n> pull using HTTPS for all repos on GitHub. The idea is, no passwords on\n> pulls and only use the password for push.\n>\n> I've got the first part of the equation using the following in my\n> ~/.gitconfig (the ellipses are user info):\n>\n>    $ cat ~/.gitconfig\n>    ...\n>    # Enforce SSH\n>    [url \"ssh://git@github.com/\"]\n>        insteadOf = https://github.com/\n\nDoes putting pushInsteadOf here work?\n\nThanks and hope that helps,\nJonathan\n"},{"id":"354516","messageId":"CAH8yC8nagnHtEosS0zNuHyh04GZYqfmL_5eR_R2qkWEBpxcM=w@mail.gmail.com","threadId":"49038","inReplyTo":"20180805012602.GB258270@aiede.svl.corp.google.com","subject":"Re: How to push using SSH and pull using HTTPS for all repos on GitHub?","fromName":"Jeffrey Walton","fromEmail":"noloader@gmail.com","sentAt":"2018-08-05T02:19:55Z","receivedAt":"2018-08-05T02:19:59Z","isPatch":false,"sender":{"key":"noloader@gmail.com","avatar":null},"body":"On Sat, Aug 4, 2018 at 9:26 PM, Jonathan Nieder <jrnieder@gmail.com> wrote:\n> Hi,\n>\n> Jeffrey Walton wrote:\n>\n>> I'm having trouble setting up my ~/.gitconfig to push using SSH and\n>> pull using HTTPS for all repos on GitHub. The idea is, no passwords on\n>> pulls and only use the password for push.\n>>\n>> I've got the first part of the equation using the following in my\n>> ~/.gitconfig (the ellipses are user info):\n>>\n>>    $ cat ~/.gitconfig\n>>    ...\n>>    # Enforce SSH\n>>    [url \"ssh://git@github.com/\"]\n>>        insteadOf = https://github.com/\n>\n> Does putting pushInsteadOf here work?\n\nYes, that was the trick.\n\nThank you very much.\n"},{"id":"354521","messageId":"20180805032854.GG258270@aiede.svl.corp.google.com","threadId":"49038","inReplyTo":"CAH8yC8nagnHtEosS0zNuHyh04GZYqfmL_5eR_R2qkWEBpxcM=w@mail.gmail.com","subject":"Re: How to push using SSH and pull using HTTPS for all repos on GitHub?","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2018-08-05T03:28:54Z","receivedAt":"2018-08-05T03:28:59Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Jeffrey Walton wrote:\n> On Sat, Aug 4, 2018 at 9:26 PM, Jonathan Nieder <jrnieder@gmail.com> wrote:\n>> Jeffrey Walton wrote:\n\n>>> I'm having trouble setting up my ~/.gitconfig to push using SSH and\n>>> pull using HTTPS for all repos on GitHub. The idea is, no passwords on\n>>> pulls and only use the password for push.\n[...]\n>>>    [url \"ssh://git@github.com/\"]\n>>>        insteadOf = https://github.com/\n>>\n>> Does putting pushInsteadOf here work?\n>\n> Yes, that was the trick.\n>\n> Thank you very much.\n\nYou're welcome.\n\nI should have asked: do you remember where you first looked for this\nanswer in documentation?  Maybe we can improve it.\n\nA few thoughts:\n\n 1. git-push(1) could get a CONFIGURATION section.\n\n 2. the description of url.*.insteadOf in git-config(1) could mention\n    pushInsteadOf.  The description of url.*.pushInstead is right\n    after it today, but there is nothing guaranteeing that that will\n    continue to be true.\n\n 3. Likewise, the description of remote.<name>.push could include a\n    pointer.\n\n 4. Maybe there's a place to put some thoughts on this in the\n    user-manual, too.  It already mentions remote.<name>.push.\n\nWhat do you think?\n\nThanks,\nJonathan\n"}]}