{"id":15763236,"url":"https://github.com/nicklegan/setup-git-and-ssh-on-windows-with-github","last_synced_at":"2026-01-08T21:37:32.013Z","repository":{"id":115245672,"uuid":"353797668","full_name":"nicklegan/setup-git-and-ssh-on-windows-with-github","owner":"nicklegan","description":"Install and configure Git, PuTTY and SSH keys on Windows with GitHub","archived":false,"fork":false,"pushed_at":"2021-04-02T16:21:03.000Z","size":4,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-04T11:41:23.756Z","etag":null,"topics":["git-for-windows","putty","ssh","ssh-key"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nicklegan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-04-01T18:54:52.000Z","updated_at":"2024-07-23T10:29:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"c961e0f6-d09d-4b43-822a-7c214ef6d1c7","html_url":"https://github.com/nicklegan/setup-git-and-ssh-on-windows-with-github","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicklegan%2Fsetup-git-and-ssh-on-windows-with-github","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicklegan%2Fsetup-git-and-ssh-on-windows-with-github/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicklegan%2Fsetup-git-and-ssh-on-windows-with-github/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicklegan%2Fsetup-git-and-ssh-on-windows-with-github/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nicklegan","download_url":"https://codeload.github.com/nicklegan/setup-git-and-ssh-on-windows-with-github/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246450474,"owners_count":20779421,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["git-for-windows","putty","ssh","ssh-key"],"created_at":"2024-10-04T11:41:03.891Z","updated_at":"2026-01-08T21:37:31.985Z","avatar_url":"https://github.com/nicklegan.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Setup Git and SSH on Windows with GitHub\nInstall and configure Git, PuTTY and SSH keys on Windows with GitHub\n\n## Setup overview\n- [Git for Windows](#Git-for-Windows)\n- [PuTTY](#PuTTY)\n  * [PuTTY Key Generator (puttygen.exe)](#PuTTY-Key-Generator-(puttygen.exe))\n  * [PuTTY Authentication Agent (pageant.exe)](#PuTTY-Authentication-Agent-(pageant.exe))\n  * [Plink - Command Line Connection Tool (plink.exe)](#Plink---Command-Line-Connection-Tool-(plink.exe))\n- [Git global config](#Git-global-config)\n- [Testing](#Testing)\n- [Resources](#Resources)\n\n\n## Git for Windows\n\n- Download and install the latest [Git for Windows](https://gitforwindows.org/)\n\n(skipped steps :point_down: can be treated having default values)\n\n1. Select Components (default)\n\n\u003cimg width=\"500\" alt=\"Screenshot 2021-04-01 at 12 51 37\" src=\"https://user-images.githubusercontent.com/60080580/113283788-0989e780-92e9-11eb-935f-21313f6b6a37.png\"\u003e\n\n2. Adjusting the default branch name for new repositories (main branch)\n\n\u003cimg width=\"500\" alt=\"Screenshot 2021-04-01 at 12 56 42\" src=\"https://user-images.githubusercontent.com/60080580/113284933-a26d3280-92ea-11eb-8351-06eee1bada22.png\"\u003e\n\n3. Adjusting your PATH environment\n\n- Git from the command line and also from 3rd party software\n\n\u003cimg width=\"500\" alt=\"Screenshot 2021-04-01 at 13 07 10\" src=\"https://user-images.githubusercontent.com/60080580/113285937-d5fc8c80-92eb-11eb-8fe6-41116d06b6e6.png\"\u003e\n\n4. Choosing HTTPS transport backend\n\n\u003cimg width=\"500\" alt=\"Screenshot 2021-04-01 at 13 14 49\" src=\"https://user-images.githubusercontent.com/60080580/113286283-46a3a900-92ec-11eb-9927-d04c38811c04.png\"\u003e\n\n5. Configuring the line ending conversions\n\n\u003cimg width=\"500\" alt=\"Screenshot 2021-04-01 at 13 16 58\" src=\"https://user-images.githubusercontent.com/60080580/113286493-908c8f00-92ec-11eb-9844-be7ae29d916a.png\"\u003e\n\n6. Use MinTTY (the default terminal of MSYS2)\n\n\u003cimg width=\"500\" alt=\"Screenshot 2021-04-01 at 13 20 12\" src=\"https://user-images.githubusercontent.com/60080580/113286859-0a247d00-92ed-11eb-933e-be38a25efaea.png\"\u003e\n\n7. Choose the default behavior of `git pull`\n\n\u003cimg width=\"500\" alt=\"Screenshot 2021-04-01 at 13 22 49\" src=\"https://user-images.githubusercontent.com/60080580/113287113-64254280-92ed-11eb-822f-f2dc68e323d6.png\"\u003e\n\n8. Choose a credential helper\n\n\u003cimg width=\"500\" alt=\"Screenshot 2021-04-01 at 13 24 36\" src=\"https://user-images.githubusercontent.com/60080580/113287261-a0f13980-92ed-11eb-839c-2d695060039b.png\"\u003e\n\n9. Configuring extra options\n\n\u003cimg width=\"500\" alt=\"Screenshot 2021-04-01 at 13 25 49\" src=\"https://user-images.githubusercontent.com/60080580/113287406-d433c880-92ed-11eb-9e19-ad2f6336d39a.png\"\u003e\n\n10. Configuring experimental options\n\n\u003cimg width=\"500\" alt=\"Screenshot 2021-04-01 at 13 26 51\" src=\"https://user-images.githubusercontent.com/60080580/113287516-fdecef80-92ed-11eb-9a94-17a32a13069b.png\"\u003e\n\n11. Completing the Git Setup Wizard\n\n- yes, restart the computer now\n\n\u003cimg width=\"500\" alt=\"Screenshot 2021-04-01 at 13 28 26\" src=\"https://user-images.githubusercontent.com/60080580/113287702-3391d880-92ee-11eb-93f6-4242854e3dec.png\"\u003e\n\n## PuTTY\n\n1. Download and install the latest [PuTTY MSI Package installer](https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html) for Windows\n\n:bulb: This package installer will also contain and automatically installs the required `plink.exe`, `pageant.exe` and `puttygen.exe` binaries required :point_down:.\n\n2. Destination folder\n\n\u003cimg width=\"500\" alt=\"Screenshot 2021-04-01 at 13 50 22\" src=\"https://user-images.githubusercontent.com/60080580/113289989-4528af80-92f1-11eb-8593-1b4dc6ec443e.png\"\u003e\n\n3. Product Features\n\n\u003cimg width=\"500\" alt=\"Screenshot 2021-04-01 at 13 55 24\" src=\"https://user-images.githubusercontent.com/60080580/113290449-f3345980-92f1-11eb-9c9d-4d9f28c1e696.png\"\u003e\n\n4. After the installation of PuTTY has finished, create a `.ssh` folder in your logged in user folder: `C:\\Users\\yourusername\\.ssh\\` or the equivalent `%USERPROFILE%\\.ssh\\`\n\n### PuTTY Key Generator (puttygen.exe)\n\n5. Run `puttygen.exe` either from the Start menu or the direct locaation at `C:\\Program Files\\PuTTY\\puttygen.exe`\n\n\u003cimg width=\"500\" alt=\"Screenshot 2021-04-01 at 15 18 17\" src=\"https://user-images.githubusercontent.com/60080580/113299770-82933a00-92fd-11eb-9479-4af4632696ec.png\"\u003e\n\n6. Click `Generate`, wiggle the mouse around in the top part of the window until the progress bar is full, as the program asks you to do.\n\n7. Enter your email address in the `Key comment` box.\n\n8. Provide a passphrase, and repeat it in the subsequent textbox.\n\n9. Click `Save private key`. Save the private key in the  `%USERPROFILE%\\.ssh\\` directory created earlier. Give the private key a personal name so it can be easily identified. This file should have a `.ppk` extension.\n\n10. In `puttygen.exe` copy the generated Public key visible under `Public key for pasting into OpenSSH authorized keys file` to your Windows clipboard (see image :point_up:).\n\n11. Open your browser and navigate to github.com and add a new [SSH key](https://github.com/settings/ssh/new) in your account settings. Choose a key title (e.g. your email address or computer name) and paste the public SSH key data from clipboard before pressing `Add SSH key`.\n\n\u003cimg width=\"800\" alt=\"Screenshot 2021-04-01 at 15 33 51\" src=\"https://user-images.githubusercontent.com/60080580/113302157-1239e800-9300-11eb-9523-3ce35a04a9c2.png\"\u003e\n\n\u003cimg width=\"800\" alt=\"Screenshot 2021-04-01 at 15 34 38\" src=\"https://user-images.githubusercontent.com/60080580/113302406-4d3c1b80-9300-11eb-9612-fe63ce32de6d.png\"\u003e\n\n:bulb: If you have and need command line access to GitHub Single sign-on organizations make sure you authorize your SSH key by activating [Enable SSO](https://docs.github.com/en/github/authenticating-to-github/authorizing-an-ssh-key-for-use-with-saml-single-sign-on) for the specific GitHub organizations.\n\n### PuTTY Authentication Agent (pageant.exe)\n\n12. To automatically run `pageant.exe` and the loaded private key at startup copy the Pageant shortcut from:\n\n```C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\PuTTY (64-bit)```\n\n```%ProgramData%\\Microsoft\\Windows\\Start Menu\\Programs\\PuTTY (64-bit)```\n\nto\n\n```C:\\Users\\your-username\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup```\n\n```%AppData%\\Microsoft\\Windows\\Start Menu\\Programs\\Startup```\n\n13. At the new Pageant shortcut startup location, right-click the Pageant shortcut and select `Properties` from the context menu.\n\n\u003cimg width=\"400\" alt=\"Screenshot 2021-04-01 at 17 44 24\" src=\"https://user-images.githubusercontent.com/60080580/113319618-eaec1680-9311-11eb-9e10-378c8cddb0a9.png\"\u003e\n\n14. At the Pageant Properties append the path to your private key in the `Target` field and press Apply:\n\n```\"C:\\Program Files\\PuTTY\\pageant.exe\" C:\\Users\\your-user-name\\.ssh\\your-private-key.ppk```\n\n15. Double click the Pageant shortcut file which starts Pageant and enter your private key passphrase.\n\n\u003cimg width=\"250\" alt=\"Screenshot 2021-04-01 at 17 51 31\" src=\"https://user-images.githubusercontent.com/60080580/113320584-f0962c00-9312-11eb-8943-2f88c8d8b90a.png\"\u003e\n\n16. On the right side of the Windows taskbar Pageant should now be running, if it was already running press `Exit` and double click the newly created startup shortcut again.\n\n\u003cimg width=\"300\" alt=\"Screenshot 2021-04-01 at 18 13 17\" src=\"https://user-images.githubusercontent.com/60080580/113323210-fd684f00-9315-11eb-82b9-245e0a9188ca.png\"\u003e\n\n17. From the Pageant menu select `View Keys` to verify that your private key is loaded.\n\n\u003cimg width=\"500\" alt=\"Screenshot 2021-04-01 at 18 21 24\" src=\"https://user-images.githubusercontent.com/60080580/113324271-381eb700-9317-11eb-8b10-ecaa3fe0de43.png\"\u003e\n\n## Plink - Command Line Connection Tool (plink.exe)\n\nTo automatically let Putty establish a connection for Git over SSH we have to configure Plink.\n\n18. Nagivate to Start menu (right-click) -\u003e System -\u003e Advanced system settings -\u003e Environment Variables. Add a new System Variable with the below entries:\n\n```Variable name: GIT_SSH```\n\n\n```Variable value: C:\\Program Files\\PuTTY\\plink.exe```\n\n\u003cimg width=\"600\" alt=\"Screenshot 2021-04-01 at 19 11 38\" src=\"https://user-images.githubusercontent.com/60080580/113330715-57b9dd80-931f-11eb-90dc-93e94b4d4d2f.png\"\u003e\n\n19. To verify if the environment variable is loaded run `Git Bash` from the Start menu (or via its absolute path: `C:\\Program Files\\Git\\git-bash.exe`) and enter the following command: ` env | grep -i ssh` which should return the enabled `GIT_SSH` variable.\n\n\u003cimg width=\"450\" alt=\"Screenshot 2021-04-01 at 19 29 05\" src=\"https://user-images.githubusercontent.com/60080580/113331722-93a17280-9320-11eb-96a6-7c44d2c9fb68.png\"\u003e\n\n## Git global config\n\nSetup your [Git username](https://docs.github.com/en/github/getting-started-with-github/setting-your-username-in-git#setting-your-git-username-for-every-repository-on-your-computer) and [commit email address](https://docs.github.com/en/github/setting-up-and-managing-your-github-user-account/setting-your-commit-email-address#setting-your-commit-email-address-in-git) for your system. Open a command prompt and enter the below lines, adding your personal info.\n\n1. `git config --global user.name \"First-name Last-name\"`\n2. `git config --global user.email your@email-address.com`\n\n## Testing\n\n1. Open a Windows command prompt and test your connection and authentication using the following command: `plink.exe -v git@github.com` the result should look like :point_down:.\n\n\u003cimg width=\"800\" alt=\"Screenshot 2021-04-01 at 19 40 03\" src=\"https://user-images.githubusercontent.com/60080580/113333610-eed46480-9322-11eb-80ea-437fd2cbe3c6.png\"\u003e\n\n2. Now try cloning a private repository using Git over SSH, when successful the expected output should look like the image :point_down: and you will be automatically authenticated.\n\n\u003cimg width=\"800\" alt=\"Screenshot 2021-04-01 at 19 51 16\" src=\"https://user-images.githubusercontent.com/60080580/113334188-b08b7500-9323-11eb-977b-538bba8a270c.png\"\u003e\n\n\u003cimg width=\"650\" alt=\"Screenshot 2021-04-01 at 19 54 22\" src=\"https://user-images.githubusercontent.com/60080580/113334660-41625080-9324-11eb-8748-5c73f4dc13bd.png\"\u003e\n\n## Resources\n- https://vladmihalcea.com/tutorials/git/windows-git-ssh-authentication-to-github/\n- https://serverfault.com/questions/194567/how-do-i-tell-git-for-windows-where-to-find-my-private-rsa-key/850156#850156","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicklegan%2Fsetup-git-and-ssh-on-windows-with-github","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnicklegan%2Fsetup-git-and-ssh-on-windows-with-github","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicklegan%2Fsetup-git-and-ssh-on-windows-with-github/lists"}