# Phase 1 - local machine steps
```bash
git remote add origin
[email protected]:user_name/repo_name.git
git config --list #ensure remote.origin.url is properly set w/o https:// - otherwise ssh connection will fail
```
![[images/Pasted image 20250822130623.png]]
```bash
ssh-keygen #create new key pair in ~/.ssh
eval "$(ssh-agent -s)" #starts ssh-agent in bg
ssh-add ~/.ssh/new_key #adds new priv key to ssh-agent
```
# Phase 2 - github steps
- add pubkey to github account
- located on local machine as `~/.ssh/new_key.pub`
- note user and repo name
# Phase 3 - local machine steps
```bash
ssh -T
[email protected] #test ssh connection
cd ~/local_repo #move to repo loc
git push origin branch_name #push local repo to github using SSH
```