{"id":3375,"date":"2014-12-10T10:26:45","date_gmt":"2014-12-10T16:26:45","guid":{"rendered":"http:\/\/bililite.com\/blog\/?p=3375"},"modified":"2014-12-10T10:26:45","modified_gmt":"2014-12-10T16:26:45","slug":"setting-up-git","status":"publish","type":"post","link":"https:\/\/bililite.com\/blog\/2014\/12\/10\/setting-up-git\/","title":{"rendered":"Setting up <code>git<\/code>"},"content":{"rendered":"<p>Now that I have my computer working, I want to get back at my <a href=\"https:\/\/github.com\/dwachss\">github repositories<\/a>. I could type my password with every push, but it's easier to use SSH with a key pair. Since I'm using <a href=\"http:\/\/www.putty.org\/\">Putty<\/a> for shell access, I use Puttygen that comes with it. The problem is that Puttygen's format is not the right one for git. There are recommendations online to set <code>$GIT_SSH<\/code> to use <code>plink<\/code> with Pageant, which does use Puttygen's format, but I read that github won't support that, so I ended up doing the following:<\/p>\n<p>Create a key pair with Puttygen. In the conversion menu, create a file in openSSH format. Create the file <code>~\/.ssh\/config<\/code>:<\/p>\n<pre><code>Host github.com\r\n\tUser git\r\n\tIdentityFile \/path\/to\/openssh-format-privatekey\r\n<\/code><\/pre>\n<p>At <a href=\"https:\/\/github.com\/settings\/ssh\">github.com<\/a> add the <strong>public<\/strong> key that you created. Back in Powershell, in the directory with the local repository, do<\/p>\n<pre><code>git remote set-url origin git@github.com:username\/repo-name.git<\/code><\/pre>\n<p>to use SSH. Now <code>git push origin master<\/code> will push the local master branch back up to github without needed a password (if you created the private key with a passphrase, you will have to enter that.<\/p>\n<p>In putty, for each host, set <code>Host Name<\/code> in the <code>Session<\/code> tab and select the private key (in Puttygen format!) in the <code>Connection->SSH->Auth<\/code> tab.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Now that I have my computer working, I want to get back at my github repositories. I could type my password with every push, but it's easier to use SSH with a key pair. Since I'm using Putty for shell access, I use Puttygen that comes with it. The problem is that Puttygen's format is [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/bililite.com\/blog\/wp-json\/wp\/v2\/posts\/3375"}],"collection":[{"href":"https:\/\/bililite.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bililite.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bililite.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/bililite.com\/blog\/wp-json\/wp\/v2\/comments?post=3375"}],"version-history":[{"count":4,"href":"https:\/\/bililite.com\/blog\/wp-json\/wp\/v2\/posts\/3375\/revisions"}],"predecessor-version":[{"id":3390,"href":"https:\/\/bililite.com\/blog\/wp-json\/wp\/v2\/posts\/3375\/revisions\/3390"}],"wp:attachment":[{"href":"https:\/\/bililite.com\/blog\/wp-json\/wp\/v2\/media?parent=3375"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bililite.com\/blog\/wp-json\/wp\/v2\/categories?post=3375"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bililite.com\/blog\/wp-json\/wp\/v2\/tags?post=3375"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}