<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Esraa Abd Elfatah on Medium]]></title>
        <description><![CDATA[Stories by Esraa Abd Elfatah on Medium]]></description>
        <link>https://medium.com/@esraa4255?source=rss-8104e27d79dc------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*Wsecp1NgQsNNKS8V</url>
            <title>Stories by Esraa Abd Elfatah on Medium</title>
            <link>https://medium.com/@esraa4255?source=rss-8104e27d79dc------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 15:01:19 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@esraa4255/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to generate SSH key for Xcode and GitLab (macOS)]]></title>
            <link>https://medium.com/@esraa4255/how-to-generate-ssh-key-for-gitlab-macos-4eb8cf30d649?source=rss-8104e27d79dc------2</link>
            <guid isPermaLink="false">https://medium.com/p/4eb8cf30d649</guid>
            <dc:creator><![CDATA[Esraa Abd Elfatah]]></dc:creator>
            <pubDate>Thu, 16 May 2024 22:12:26 GMT</pubDate>
            <atom:updated>2024-05-19T13:34:34.554Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>Recently, I received a new MacBook for work , and I’m currently setting up my development environment. One of the essential tasks is to configure Xcode and Git with SSH. In this guide, I’ll walk you through the steps to set up SSH for GitLab on macOS and explain why using an SSH key might be more beneficial than using an access token.</p><h3>SSH Key vs. Access Token</h3><p>Using an SSH key is generally more secure and convenient than using an access token. SSH keys are generated locally and stored on your computer, providing a robust method of authentication that does not require entering credentials each time you interact with a remote repository. On the other hand, access tokens can be less secure as they are stored in plain text and need to be managed carefully to avoid exposure. Additionally, SSH keys offer a seamless experience when working with Git, especially for frequent operations like pushing and pulling changes.</p><h3><strong><em>Lets start our steps to set up SSH</em></strong></h3><h3>Step 1: Open Terminal</h3><p>Open the Terminal application on your macOS. You can find it by searching for “Terminal” using Spotlight.</p><h3>Step 2: Check Git Version</h3><p>Run the following command to check the version of Git installed on your system:</p><pre>git --version</pre><p>When you run this command, you should see output similar to the following, which indicates the version of Git currently installed:</p><pre>git version 2.32.0</pre><p>If Git is not installed, you will see a message indicating that the command was not found. In that case, you’ll need to install Git.</p><h3>Installing Git on macOS</h3><p>If you find that Git is not installed, you can install it using various methods:</p><h4>1. Homebrew</h4><p>Homebrew is a popular package manager for macOS. If you have Homebrew installed, you can install Git with the following command:</p><pre>brew install git</pre><h4>2. Xcode Command Line Tools</h4><p>Installing Xcode Command Line Tools is another way to get Git on macOS. Run the following command:</p><pre>xcode-select --install</pre><h4>3. Download from the Official Website</h4><p>You can also download Git directly from the official Git website:</p><p>Visit the <a href="https://git-scm.com/download/mac">Git downloads page</a>.</p><h4>Verifying Installation</h4><p>After installing Git, run the git --version command again to verify that the installation was successful and to check the installed version:</p><pre>git --version</pre><p>You should now see the version information for Git, confirming that it is installed and ready to use on your macOS system.</p><h3>Step 3: Set your Git username and email</h3><p>To set your Git username and email, which Git uses for commits you make, you can use the following commands:</p><p><strong>1.Set your Git username with the following command:</strong></p><pre>git config --global user.name &quot;Your Full Name&quot;</pre><p><strong>2.Set your Git email with the following command:</strong></p><pre>git config --global user.email &quot;you@example.com&quot;</pre><h3>Step 4: Generate SSH Key</h3><p>Generate a new SSH key pair:</p><ol><li>In Terminal, run:</li></ol><pre>ssh-keygen -t ed25519 -C &quot;your_email@example.com&quot;</pre><p>If ed25519 is not supported, use:</p><pre>ssh-keygen -t rsa -b 4096 -C &quot;your_email@example.com&quot;</pre><p>Replace &quot;your_email@example.com&quot; with the email associated with your GitLab account.</p><p>2. When prompted, press Enter to save the key in the default location.</p><p>3. Enter and confirm a passphrase (or leave it empty).</p><h3>Step 5: Add SSH Key to SSH Agent</h3><p>Start the SSH agent and add your SSH key:</p><ol><li>Start the SSH agent:</li></ol><pre>eval &quot;$(ssh-agent -s)&quot;</pre><p>2. Add your SSH private key:</p><pre>ssh-add ~/.ssh/id_ed25519</pre><p>For RSA, use:</p><pre>ssh-add ~/.ssh/id_rsa</pre><h3>Step 6: Add SSH Key to GitLab</h3><ol><li>Copy the SSH public key to your clipboard:</li></ol><pre>pbcopy &lt; ~/.ssh/id_ed25519.pub</pre><p>For RSA, use:</p><pre>pbcopy &lt; ~/.ssh/id_rsa.pub</pre><ol><li>Log in to GitLab.</li><li>Go to Settings &gt; SSH Keys.</li><li>Paste the key into the Key field.</li><li>Add a descriptive title and click Add key.</li></ol><h3>Step 7: Clone Repository Using SSH</h3><p>To clone a GitLab repository using SSH, navigate to the repository’s page, click on “Code,” and select “SSH” to get the SSH URL. Then, in Terminal, navigate to the directory where you want to clone the repository and run:</p><pre>git clone git@gitlab.com:USERNAME/REPOSITORY.git</pre><p>Replace USERNAME with your GitLab username and REPOSITORY with the name of the repository.</p><p>By following these steps, you will have generated an SSH key for GitLab on macOS and configured your system to use it and can clone any project with SSH .</p><h3>Conclusion</h3><p>This is my first article on Medium about iOS development, and I hope it proves to be helpful for those setting up their development environment. If you have any questions or feedback, please feel free to reach out.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4eb8cf30d649" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>