You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: _posts/2023-01-11-ssh-key-github-windows-powershell.md
+17-16
Original file line number
Diff line number
Diff line change
@@ -8,32 +8,33 @@ tags: development powershell windows git github ssh
8
8
I've been a long-time fan of Linux and MacOS for development, but I recently set a challenge for myself to set up my development environment in Windows PowerShell. One part of that is working with Git and repositories in GitHub.
Press the Windows key or open the Start menu and search for "Services"
17
-
Double-click on "OpenSSH Authentication Agent"
18
-
Change Startup type to `Automatic`
19
-
Click **Start** under Service Status
11
+
1. Click the **Start** menu and navigate to Settings -> Apps -> Apps & Features -> Optional Features (or just press the Windows key and search for "Optional Features")
12
+
2. In the "Optional Features" window, check to make sure OpenSSH Client is in the list. Otherwise click **Add a feature** and add it.
13
+
3. Press the Windows key or open the Start menu and search for "Services"
14
+
4. In the "Services" window, double-click on "OpenSSH Authentication Agent"
15
+
5. Change "Startup type" to `Automatic`
16
+
6. Click the **Start** button under "Service Status"
20
17
21
18
## Step 2: Install Git
22
19
1. Download [Git for Windows](https://git-scm.com) and run the installer.
23
20
2. At the "Adjusting your PATH environment" step, select the "Git from the command line and also from 3rd-party software" option.
24
21
3. At the "Choosing the SSH executable" step, select "Use external OpenSSH".
25
22
4. Choose the rest of the options at your discretion.
26
23
5. (Optional) [Install Posh Git and other helpers](https://git-scm.com/book/en/v2/Appendix-A%3A-Git-in-Other-Environments-Git-in-PowerShell).
27
-
1. Right-click PowerShell and click "Run as Administrator"
28
-
2. Run `Set-ExecutionPolicy -Scope LocalMachine -ExecutionPolicy RemoteSigned -Force`
29
-
3. Close that window and open PowerShell normally.
30
-
4. Run `Install-Module posh-git -Scope CurrentUser -Force`
31
-
5. Run `Import-Module posh-git`
32
-
6. Run `Add-PoshGitToProfile -AllHosts` to load posh-git automatically whenever PowerShell starts.
24
+
1. Right-click PowerShell and click "Run as Administrator"
25
+
2. Run `Set-ExecutionPolicy -Scope LocalMachine -ExecutionPolicy RemoteSigned -Force`
26
+
3. Close that window and open PowerShell normally.
27
+
4. Run `Install-Module posh-git -Scope CurrentUser -Force`
28
+
5. Run `Import-Module posh-git`
29
+
6. Run `Add-PoshGitToProfile -AllHosts` to load posh-git automatically whenever PowerShell starts.
33
30
34
31
## Step 3: Generate the SSH Key and add it to GitHub
35
32
1. Open PowerShell
36
33
2. Run `ssh-keygen -t ed25519 -C "[email protected]"` and follow the prompts.
37
34
3. Run `ssh-add.exe ~\.ssh\id_ed25519` to add the key to your ssh-agent.
38
35
4. Run `Get-Content ~\.ssh\id_ed25519.pub | clip`. This will copy the public key to your clipboard.
39
-
5.[Add a new SSH key in GitHub](https://github.com/settings/ssh/new) and paste the public key into the "Key" field
36
+
5.[Add a new SSH key in GitHub](https://github.com/settings/ssh/new) and paste the public key into the "Key" field
0 commit comments