Skip to content

Commit

Permalink
ssh and migrate
Browse files Browse the repository at this point in the history
  • Loading branch information
TonyPhipps committed Jul 29, 2024
1 parent ea07ecb commit 8e90082
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions Products/git.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,41 @@ Display recent Git Changes
git --no-pager log --pretty=format:'\"%h\", \"%an\", \"%ci\", \"%s\", \"%b\"' --after "2023-11-30"
```



# Setup SSH Key
Generate a key pair
```
ssh-keygen -t ed25519 -C "[email protected]"
```

Start the ssh-agent in the background (as admin)
```
Get-Service -Name ssh-agent | Set-Service -StartupType Manual
Start-Service ssh-agent
```

Add the SSH key to the ssh-agent (as non-admin)
```
sh-add c:/Users/YOU/.ssh/id_ed25519
```

Add the SSH key to the Github account
- Name > Settings > SSH and GPG Keys
- New SSH Key
- Copy contents of publickey.pub
- Paste into text block and provide a name

Attempt a Clone
- At the main repo page, click <> Code
- Go to Local > SSH tab
- Copy the Git address for SSH and use it to clone via VSCode


# Migrate a Repo
```
git remote add remoterepo https://[email protected]/yourLogin/yourRepoName.git
git push --mirror remoterepo
```

Then go in and set the default branch and remove the old default as needed.

0 comments on commit 8e90082

Please sign in to comment.