-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathgitbashcode
More file actions
40 lines (38 loc) · 1.37 KB
/
gitbashcode
File metadata and controls
40 lines (38 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
Sure! Here's a cleaned-up version of the Git Bash steps, using an RSA SSH key instead of ed25519 and with no emojis or custom icons.
________________________________________
Git Bash Steps to Generate RSA Key and Upload to GitHub
1. Generate an RSA SSH Key
Open Git Bash and run:
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
• Press Enter to accept the default file location: ~/.ssh/id_rsa
• Enter a passphrase (optional)
Then display and copy the public key:
cat ~/.ssh/id_rsa.pub
2. Add SSH Key to GitHub
1. Go to https://github.com
2. Click your profile photo, then Settings
3. Go to SSH and GPG keys
4. Click New SSH key
5. Paste the copied public key
6. Click Add SSH key
3. Create a Repository on GitHub
1. Visit https://github.com/new
2. Enter the repository name, e.g., my-first-repo
3. Choose Public or Private
4. Leave "Initialize this repository with a README" unchecked
5. Click Create repository
4. Set Up Local Repository with Git Bash
cd /path/to/your/projects
mkdir my-first-repo
cd my-first-repo
git init
touch README.md
git add README.md
git commit -m "Initial commit"
5. Connect to GitHub and Push
Replace your-username with your actual GitHub username:
git remote add origin git@github.com:your-username/my-first-repo.git
git push -u origin master
If your GitHub repository defaults to the main branch instead of master, use:
git branch -M main
git push -u origin main