Skip to content

Commit b04afb8

Browse files
author
Prem Singh
authored
Update README.md
1 parent d920db2 commit b04afb8

File tree

1 file changed

+57
-71
lines changed

1 file changed

+57
-71
lines changed

README.md

Lines changed: 57 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,140 +1,126 @@
1-
🚀 GitHub SSH Guide: Upload and Download Files
1+
# GitHub SSH Guide: Upload and Download Files
22

33
This guide shows you how to:
44

5-
✅ Set up SSH with GitHub
6-
7-
🧾 Set your Git name and email
8-
9-
⬆️ Upload (push) files to GitHub
10-
11-
⬇️ Download (clone) files from GitHub
12-
13-
5+
* ✅ Set up SSH with GitHub
6+
* ✍️ Set your Git name and email
7+
* ⬆️ Upload (push) files to GitHub
8+
* ⬇️ Download (clone) files from GitHub
149

1510
---
1611

17-
🛠️ 1. Set Up SSH (Do Once)
12+
## 🛠️ 1. Set Up SSH (Do Once)
1813

19-
🔐 1.1 – Make a New SSH Key
14+
### 1.1 – Make a New SSH Key
2015

16+
```bash
2117
ssh-keygen -t ed25519 -C "your_email@example.com"
18+
```
2219

23-
Press Enter to save in the default location
24-
25-
Press Enter again for no passphrase (or type one for extra security)
20+
* Press **Enter** to save in the default place
21+
* Press **Enter** again when asked for passphrase (or type one to protect your key)
2622

23+
### 1.2 – Start the SSH Agent
2724

28-
⚙️ 1.2 – Start the SSH Agent
29-
25+
```bash
3026
eval "$(ssh-agent -s)"
27+
```
3128

32-
1.3 – Add Your SSH Key to the Agent
29+
### 1.3 – Add Your SSH Key to the Agent
3330

31+
```bash
3432
ssh-add ~/.ssh/id_ed25519
33+
```
3534

36-
📋 1.4 – Copy Your SSH Key
35+
### 1.4 – Copy Your SSH Key
3736

37+
```bash
3838
cat ~/.ssh/id_ed25519.pub
39+
```
3940

40-
Copy the full key (starts with ssh-ed25519)
41-
41+
* Copy the full key (starts with `ssh-ed25519`)
4242

43-
🔗 1.5 – Add the Key to GitHub
43+
### 1.5 – Add the Key to GitHub
4444

45-
Open GitHub SSH settings
45+
* Go to [GitHub SSH settings](https://github.com/settings/keys)
46+
* Click **New SSH key**
47+
* Paste your key and save it
4648

47-
Click New SSH key
48-
49-
Paste your key, give it a name, and save
50-
51-
52-
✅ 1.6 – Test If SSH Works
49+
### 1.6 – Test If SSH Works
5350

51+
```bash
5452
ssh -T git@github.com
55-
56-
You should see:
57-
58-
59-
Hi username! You've successfully authenticated, but GitHub does not provide shell access.
60-
53+
```
6154

6255
---
6356

64-
🧾 2. Set Git Name and Email (Do Once)
65-
66-
👤 Configure Your Identity
57+
## 🧾 2. Set Git Name and Email (Do Once)
6758

59+
```bash
6860
git config --global user.name "Your Name"
6961
git config --global user.email "your@email.com"
62+
```
7063

71-
🔍 Check Current Settings
64+
To check:
7265

66+
```bash
7367
git config --global user.name
7468
git config --global user.email
75-
76-
🔒 Optional: Mark Folder as Safe (Avoid Warnings)
77-
78-
git config --global --add safe.directory ...
79-
69+
```
8070

8171
---
8272

83-
⬆️ 3. Upload Files to GitHub Using SSH
73+
## ⬆️ 3. Upload Files to GitHub Using SSH
8474

85-
🌿 3.1 – Set main as Default Branch (Do Once)
75+
### 3.1 – Set `main` as Default Branch (Do Once)
8676

77+
```bash
8778
git config --global init.defaultBranch main
79+
```
8880

89-
🆕 3.2 – Make a New GitHub Repo
90-
91-
Go to Create New Repo
92-
93-
Name your repo
94-
95-
Uncheck “Initialize with README”
96-
97-
Click Create repository
81+
### 3.2 – Make a New GitHub Repo
9882

83+
* Go to [https://github.com/new](https://github.com/new)
84+
* Give it a name, uncheck **README**, and create it
9985

100-
📁 3.3 – Create Local Folder and Git Repo
86+
### 3.3 – Create Local Folder and Git Repo
10187

88+
```bash
10289
mkdir my-repo
10390
cd my-repo
10491
git init
92+
```
10593

106-
📄 3.4 – Add a File and Commit
94+
### 3.4 – Add a File and Save It
10795

96+
```bash
10897
echo "Hello GitHub" > file.txt
10998
git add file.txt
11099
git commit -m "Initial commit"
100+
```
111101

112-
🔗 3.5 – Connect to GitHub and Upload
102+
### 3.5 – Connect to GitHub and Upload
113103

104+
```bash
114105
git remote add origin git@github.com:your-username/my-repo.git
115106
git branch -M main
116107
git push -u origin main
117-
108+
```
118109

119110
---
120111

121-
⬇️ 4. Download a GitHub Repo Using SSH
122-
123-
📎 4.1 – Copy SSH Link from GitHub
112+
## ⬇️ 4. Download a GitHub Repo Using SSH
124113

125-
Go to your repo → Code → SSH
114+
### 4.1 – Copy SSH Link from GitHub
126115

127-
Copy the SSH link
116+
* Click **Code****SSH** and copy it
128117

118+
### 4.2 – Clone It
129119

130-
📥 4.2 – Clone It
131-
120+
```bash
132121
git clone git@github.com:your-username/my-repo.git
133-
122+
```
134123

135124
---
136125

137-
> 🎉 All done! You can now securely push and pull code with GitHub using SSH.
138-
139-
140-
126+
> ✅ Done! You’re all set to use Git and GitHub with SSH.

0 commit comments

Comments
 (0)