|
1 | | -# Step 3: Install Git Bash, Set Up SSH Key, and Clone the Repository |
2 | | - |
3 | | -## 1. Install Git Bash |
4 | | - |
| 1 | +Step 2: Install Git Bash, Set Up SSH Key, and Clone the Repository |
| 2 | +1. Install Git Bash |
5 | 3 | Git Bash is a command-line shell for Windows that provides Git and Unix commands. |
6 | 4 |
|
7 | | -- Download Git Bash here: |
8 | | - [https://git-scm.com/downloads](https://git-scm.com/downloads) |
9 | | -- Run the installer and follow the setup instructions. |
10 | | -- After installation, open Git Bash (e.g., from the Start menu). |
| 5 | +Download Git Bash from the official website: |
| 6 | +https://git-scm.com/downloads |
11 | 7 |
|
12 | | -## 2. Generate SSH Key and Start SSH Agent |
| 8 | +Run the installer and follow the setup instructions. |
13 | 9 |
|
14 | | -SSH keys allow secure authentication with GitHub without entering your password every time. |
| 10 | +After installation, open Git Bash (e.g. from the Start menu). |
15 | 11 |
|
16 | | -### 2.1 Check for existing SSH keys |
| 12 | +2. Generate SSH Key and Start SSH Agent |
| 13 | +SSH keys allow secure authentication with GitHub without typing your password every time. |
17 | 14 |
|
| 15 | +2.1 Check for existing SSH keys |
18 | 16 | Open Git Bash and run: |
19 | 17 |
|
20 | | -```bash |
21 | | -ls ~/.ssh |
22 | | - |
23 | | -If you see files like id_ed25519 and id_ed25519.pub, you already have an SSH key. If not, continue to step 2.2. |
| 18 | +<pre> ls ~/.ssh </pre> |
| 19 | +If you see files like id_ed25519 and id_ed25519.pub, you already have an SSH key and can skip to step 2.4. |
| 20 | +If you don’t, continue with the next step. |
24 | 21 |
|
25 | 22 | 2.2 Generate a new SSH key |
26 | | -Create a new SSH key using the recommended Ed25519 algorithm: |
| 23 | +Run this command to create a new SSH key using the Ed25519 algorithm: |
27 | 24 |
|
28 | | -bash |
29 | | -Kopieren |
30 | | -Bearbeiten |
31 | | -ssh-keygen -t ed25519 -C "your.email@example.com" |
32 | | -Press Enter to accept the default file location (/c/Users/YourUsername/.ssh/id_ed25519). |
33 | | - |
34 | | -Optionally enter a passphrase for added security, or press Enter to leave it empty. |
| 25 | +<pre> ssh-keygen -t ed25519 -C "your_email@example.com" </pre> |
| 26 | +Press Enter to accept the default file location, then (optionally) enter a secure passphrase. |
35 | 27 |
|
36 | 28 | 2.3 Start the SSH agent |
37 | | -Start the SSH agent which manages your keys: |
| 29 | +Start the SSH agent in the background with: |
38 | 30 |
|
39 | | -bash |
40 | | -Kopieren |
41 | | -Bearbeiten |
42 | | -eval "$(ssh-agent -s)" |
| 31 | +<pre> eval "$(ssh-agent -s)" </pre> |
43 | 32 | 2.4 Add your SSH key to the agent |
44 | | -Add the SSH private key you just created to the agent: |
45 | | - |
46 | | -bash |
47 | | -Kopieren |
48 | | -Bearbeiten |
49 | | -ssh-add ~/.ssh/id_ed25519 |
50 | | -2.5 Copy your public SSH key |
51 | | -Display your public SSH key and copy its entire content: |
52 | | - |
53 | | -bash |
54 | | -Kopieren |
55 | | -Bearbeiten |
56 | | -cat ~/.ssh/id_ed25519.pub |
57 | | -It should look like this: |
58 | | - |
59 | | -bash |
60 | | -Kopieren |
61 | | -Bearbeiten |
62 | | -ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK2ohzmAhDaTtegkkRluKcpXo2ecGlLOV/pCFbprh5Ro your.email@example.com |
63 | | -3. Add the SSH key to your GitHub account |
64 | | -Log in to GitHub: https://github.com |
| 33 | +Now add your private key to the agent: |
65 | 34 |
|
66 | | -Click on your profile picture (top-right) → Settings |
| 35 | +<pre> ssh-add ~/.ssh/id_ed25519 </pre> |
| 36 | +You should see confirmation like: |
67 | 37 |
|
68 | | -Select SSH and GPG keys from the sidebar |
| 38 | +Identity added: /c/Users/YOUR_NAME/.ssh/id_ed25519 (your_email@example.com) |
69 | 39 |
|
70 | | -Click New SSH key |
| 40 | +3. Add the SSH key to your GitHub account |
| 41 | +Copy the contents of your public key file: |
71 | 42 |
|
72 | | -Give your key a descriptive title (e.g., "My Laptop") |
| 43 | +<pre> cat ~/.ssh/id_ed25519.pub </pre> |
| 44 | +Go to GitHub > Settings > SSH and GPG keys |
73 | 45 |
|
74 | | -Paste your copied public SSH key into the "Key" field |
| 46 | +Click New SSH key, give it a name (e.g. "My Laptop") |
75 | 47 |
|
76 | | -Click Add SSH key |
| 48 | +Paste the key into the "Key" field and click Add SSH key |
77 | 49 |
|
78 | 50 | 4. Test your SSH connection to GitHub |
79 | | -Run: |
80 | | - |
81 | | -bash |
82 | | -Kopieren |
83 | | -Bearbeiten |
84 | | -ssh -T git@github.com |
85 | | -You should see a message like: |
86 | | - |
87 | | -vbnet |
88 | | -Kopieren |
89 | | -Bearbeiten |
90 | | -Hi YourGitHubUsername! You've successfully authenticated, but GitHub does not provide shell access. |
91 | | -5. Clone the repository |
92 | | -Now you can clone the repository: |
93 | | -
|
94 | | -bash |
95 | | -Kopieren |
96 | | -Bearbeiten |
97 | | -git clone git@github.com:Cerulean-Circle-GmbH/WODA.2023.git |
98 | | -This will download the repository into your current folder. |
99 | | -
|
100 | | -Summary of important commands |
101 | | -bash |
102 | | -Kopieren |
103 | | -Bearbeiten |
104 | | -# Generate SSH key |
105 | | -ssh-keygen -t ed25519 -C "your.email@example.com" |
106 | | -
|
107 | | -# Start SSH agent |
108 | | -eval "$(ssh-agent -s)" |
109 | | -
|
110 | | -# Add SSH key to agent |
111 | | -ssh-add ~/.ssh/id_ed25519 |
112 | | -
|
113 | | -# Show public SSH key |
114 | | -cat ~/.ssh/id_ed25519.pub |
115 | | -
|
116 | | -# Test GitHub SSH connection |
117 | | -ssh -T git@github.com |
118 | | -
|
119 | | -# Clone repository |
120 | | -git clone git@github.com:Cerulean-Circle-GmbH/WODA.2023.git |
| 51 | +Verify everything is working: |
| 52 | + |
| 53 | +<pre> ssh -T git@github.com </pre> |
| 54 | +You should see: |
| 55 | + |
| 56 | +Hi USERNAME! You've successfully authenticated, but GitHub does not provide shell access. |
| 57 | + |
| 58 | +5. Clone the Repository |
| 59 | +Now that SSH is set up, you can clone the repository: |
| 60 | + |
| 61 | +<pre> git clone git@github.com:Cerulean-Circle-GmbH/WODA.2023.git </pre> |
| 62 | +You should see output like: |
| 63 | + |
| 64 | +<pre> Cloning into 'WODA.2023'... remote: Enumerating objects: ... ... Resolving deltas: ... </pre> |
0 commit comments