|
74 | 74 | </li>
|
75 | 75 | </ul>
|
76 | 76 | </li>
|
77 |
| - <li class="toctree-l3"><a class="reference internal" href="#section-1-configuring-git">Section 1: Configuring Git</a> |
| 77 | + <li class="toctree-l3"><a class="reference internal" href="#configuring-git">Configuring Git</a> |
78 | 78 | <ul>
|
79 | 79 | <li class="toctree-l4"><a class="reference internal" href="#setting-up-user-information">Setting Up User Information</a>
|
| 80 | + </li> |
| 81 | + <li class="toctree-l4"><a class="reference internal" href="#verifying-configuration">Verifying Configuration</a> |
| 82 | + </li> |
| 83 | + </ul> |
| 84 | + </li> |
| 85 | + <li class="toctree-l3"><a class="reference internal" href="#generating-ssh-keys">Generating SSH Keys</a> |
| 86 | + <ul> |
| 87 | + <li class="toctree-l4"><a class="reference internal" href="#generating-an-ssh-key">Generating an SSH Key</a> |
| 88 | + </li> |
| 89 | + <li class="toctree-l4"><a class="reference internal" href="#adding-ssh-key-to-githubgitlab">Adding SSH Key to GitHub/GitLab</a> |
80 | 90 | </li>
|
81 | 91 | </ul>
|
82 | 92 | </li>
|
| 93 | + <li class="toctree-l3"><a class="reference internal" href="#proxy-configuration-optional">Proxy Configuration (Optional)</a> |
| 94 | + <ul> |
| 95 | + <li class="toctree-l4"><a class="reference internal" href="#setting-up-a-proxy">Setting Up a Proxy</a> |
| 96 | + </li> |
| 97 | + <li class="toctree-l4"><a class="reference internal" href="#verifying-proxy-configuration">Verifying Proxy Configuration</a> |
| 98 | + </li> |
| 99 | + </ul> |
| 100 | + </li> |
| 101 | + <li class="toctree-l3"><a class="reference internal" href="#practical-exercise">Practical Exercise</a> |
| 102 | + </li> |
| 103 | + <li class="toctree-l3"><a class="reference internal" href="#additional-resources">Additional Resources</a> |
| 104 | + </li> |
83 | 105 | </ul>
|
84 | 106 | </li>
|
85 | 107 | <li class="toctree-l2"><a class="reference internal" href="../git-and-github/">Git And Github</a>
|
@@ -127,70 +149,71 @@ <h3 id="objectives">Objectives</h3>
|
127 | 149 | <li>Set and manage your Git user identity.</li>
|
128 | 150 | <li>Configure a proxy for Git operations (if required).</li>
|
129 | 151 | </ul>
|
130 |
| -<hr /> |
131 |
| -<h2 id="section-1-configuring-git">Section 1: Configuring Git</h2> |
| 152 | +<h2 id="configuring-git">Configuring Git</h2> |
132 | 153 | <h3 id="setting-up-user-information">Setting Up User Information</h3>
|
133 | 154 | <p>To personalize your Git environment, configure your username and email. This information will be attached to every commit you make.</p>
|
134 | 155 | <p>Use the following commands:</p>
|
135 | 156 | <pre><code class="language-bash">git config --global user.name "Your Name"
|
136 | 157 | git config --global user.email " [email protected]"
|
137 | 158 | </code></pre>
|
138 |
| -<p>Verifying Configuration</p> |
| 159 | +<h3 id="verifying-configuration">Verifying Configuration</h3> |
139 | 160 | <p>To check your current settings, use:</p>
|
140 | 161 | <pre><code class="language-bash">git config --list
|
141 | 162 | </code></pre>
|
142 |
| -<p>Task: |
143 |
| -Set your username and email, then verify the configuration using the above command.</p> |
144 |
| -<p>Section 2: Generating SSH Keys</p> |
| 163 | +<p>!!! task |
| 164 | + Set your username and email, then verify the configuration using the above command.</p> |
| 165 | +<h2 id="generating-ssh-keys">Generating SSH Keys</h2> |
145 | 166 | <p>SSH keys provide secure access to Git services (like GitHub or GitLab), allowing you to interact with remote repositories without entering your password every time.</p>
|
146 |
| -<p>Generating an SSH Key</p> |
| 167 | +<h3 id="generating-an-ssh-key">Generating an SSH Key</h3> |
147 | 168 | <p>Run the following command in your terminal:</p>
|
148 | 169 | <pre><code class="language-bash">ssh-keygen -t rsa -b 4096
|
149 | 170 | </code></pre>
|
150 | 171 | <p>Follow the prompts and press Enter to accept the default file location.</p>
|
151 |
| -<p>Adding SSH Key to GitHub/GitLab</p> |
| 172 | +<h3 id="adding-ssh-key-to-githubgitlab">Adding SSH Key to GitHub/GitLab</h3> |
152 | 173 | <p>Once the key is generated:</p>
|
153 |
| -<ul> |
154 |
| -<li>Copy the public key to your clipboard:</li> |
155 |
| -</ul> |
156 |
| -<pre><code class="language-bash">cat ~/.ssh/id_rsa.pub |
157 |
| -</code></pre> |
158 |
| -<ul> |
159 |
| -<li>Go to your GitHub or GitLab account settings.</li> |
| 174 | +<ol> |
| 175 | +<li> |
| 176 | +<p>Copy the public key to your clipboard:</p> |
| 177 | +<p><code>bash |
| 178 | +cat ~/.ssh/id_rsa.pub</code></p> |
| 179 | +</li> |
| 180 | +<li> |
| 181 | +<p>Go to your GitHub or GitLab account settings.</p> |
| 182 | +</li> |
160 | 183 | <li>Navigate to SSH and GPG keys and paste the key.</li>
|
161 |
| -</ul> |
162 |
| -<p>Task: |
163 |
| -Generate an SSH key and add it to your GitHub or GitLab account.</p> |
164 |
| -<p>Section 3: Proxy Configuration (Optional)</p> |
165 |
| -<p>If you’re working behind a corporate firewall or restricted network, you may need to configure Git to use a proxy.</p> |
166 |
| -<p>Setting Up a Proxy</p> |
| 184 | +</ol> |
| 185 | +<p>!!! task |
| 186 | + Generate an SSH key and add it to your GitHub or GitLab account.</p> |
| 187 | +<h2 id="proxy-configuration-optional">Proxy Configuration (Optional)</h2> |
| 188 | +<p>If you're working behind a corporate firewall or restricted network, you may need to configure Git to use a proxy.</p> |
| 189 | +<h3 id="setting-up-a-proxy">Setting Up a Proxy</h3> |
167 | 190 | <p>To set up a proxy, run:</p>
|
168 |
| -<p>```bash |
169 |
| -git config --global http.proxy http://proxy.example.com:8080</p> |
170 |
| -<p>Replace proxy.example.com:8080 with your actual proxy details.</p> |
171 |
| -<p>Verifying Proxy Configuration</p> |
| 191 | +<pre><code class="language-bash">git config --global http.proxy http://proxy.example.com:8080 |
| 192 | +</code></pre> |
| 193 | +<p>Replace <code>proxy.example.com:8080</code> with your actual proxy details.</p> |
| 194 | +<h3 id="verifying-proxy-configuration">Verifying Proxy Configuration</h3> |
172 | 195 | <p>To confirm the proxy is set up correctly:</p>
|
173 |
| -<p>```bash |
174 |
| -git config --global http.proxy</p> |
175 |
| -<p>Task: |
176 |
| -If needed, configure your proxy settings and verify them using the above commands.</p> |
177 |
| -<p>Practical Exercise</p> |
178 |
| -<p>Follow these steps to complete your setup:</p> |
179 |
| -<pre><code>- Configure Git with your username and email. |
180 |
| -- Generate an SSH key and add it to your GitHub or GitLab account. |
181 |
| -- If necessary, set up a proxy. |
| 196 | +<pre><code class="language-bash">git config --global http.proxy |
182 | 197 | </code></pre>
|
| 198 | +<p>!!! task |
| 199 | + If needed, configure your proxy settings and verify them using the above commands.</p> |
| 200 | +<h2 id="practical-exercise">Practical Exercise</h2> |
| 201 | +<p>Follow these steps to complete your setup:</p> |
| 202 | +<ol> |
| 203 | +<li>Configure Git with your username and email.</li> |
| 204 | +<li>Generate an SSH key and add it to your GitHub or GitLab account.</li> |
| 205 | +<li>If necessary, set up a proxy.</li> |
| 206 | +</ol> |
183 | 207 | <p>Verify your configuration with:</p>
|
184 |
| -<p>```bash |
185 |
| -git config --list</p> |
186 |
| -<p>Additional Resources</p> |
| 208 | +<pre><code class="language-bash">git config --list |
| 209 | +</code></pre> |
| 210 | +<h2 id="additional-resources">Additional Resources</h2> |
187 | 211 | <ul>
|
188 |
| -<li>Official Git Documentation</li> |
189 |
| -<li>GitHub SSH Key Setup Guide</li> |
190 |
| -<li>Git Configuration Best Practices</li> |
| 212 | +<li><a href="https://git-scm.com/doc">Official Git Documentation</a></li> |
| 213 | +<li><a href="https://docs.github.com/en/authentication/connecting-to-github-with-ssh">GitHub SSH Key Setup Guide</a></li> |
| 214 | +<li><a href="https://git-scm.com/book/en/v2/Customizing-Git-Git-Configuration">Git Configuration Best Practices</a></li> |
191 | 215 | </ul>
|
192 |
| -<p>With these steps completed, Git is now properly configured on your machine, and you’re ready to start working with version control.</p> |
193 |
| -<p>This format is designed for an MkDocs-based project, with clear sections and tasks. Let me know if you'd like to make any further adjustments!</p> |
| 216 | +<p>With these steps completed, Git is now properly configured on your machine, and you're ready to start working with version control. Happy coding!</p> |
194 | 217 |
|
195 | 218 | </div>
|
196 | 219 | </div><footer>
|
|
0 commit comments