> ## Documentation Index
> Fetch the complete documentation index at: https://fastapi2day.codewithsiva.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Setting Up Your GitHub Account and Local Git Config

> Create your GitHub account, configure Git with your identity, and choose the right authentication method for pushing and pulling code.

GitHub is free to use and takes about five minutes to set up. Having an account unlocks the ability to back up your code, publish your projects publicly or privately, download AI tools and examples from the community, and collaborate with other developers. Your GitHub profile also acts as a living portfolio that potential employers can browse — so it's worth setting up properly from the start.

## Step 1: Sign up

<Steps>
  <Step title="Go to GitHub">
    Visit [github.com](https://github.com) and click **Sign up**.
  </Step>

  <Step title="Enter your details">
    * **Username** — Pick something professional; employers will see this
    * **Email** — Use one you check regularly
    * **Password** — Make it strong
  </Step>

  <Step title="Verify your account">
    GitHub sends you a confirmation email. Click the link inside to activate your account.
  </Step>

  <Step title="Set up your profile">
    Click your profile picture (top right) → **Your profile** → **Edit profile**. Add your real name, a profile photo, and a short bio such as *"Learning Python for AI development"*.
  </Step>
</Steps>

## Step 2: Configure Git locally

Tell Git who you are — this is a one-time setup that attaches your name and email to every commit you make:

```bash theme={null}
git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"
```

Use the same email address you registered with on GitHub.

## Step 3: Choose your authentication method

When you push code to GitHub, you need to prove you own the account. There are three ways to do this:

<Note>
  **Recommended:** GitHub CLI gives you the simplest setup experience. It's the modern approach and handles authentication automatically, so you won't need to paste tokens or manage SSH keys manually.
</Note>

<Tabs>
  <Tab title="GitHub CLI (Recommended)">
    ### Install GitHub CLI

    <CodeGroup>
      ```bash macOS theme={null}
      brew install gh
      ```

      ```powershell Windows theme={null}
      winget install --id GitHub.cli
      ```

      ```bash Linux theme={null}
      # See full instructions at cli.github.com
      ```
    </CodeGroup>

    You can also download directly from [cli.github.com](https://cli.github.com).

    ### Authenticate

    ```bash theme={null}
    gh auth login
    ```

    Follow the interactive prompts:

    1. Choose **GitHub.com**
    2. Choose **SSH** (recommended) or **HTTPS**
    3. Authenticate via browser

    That's it — Git will automatically use your credentials from this point on.
  </Tab>

  <Tab title="HTTPS with Token">
    ### Generate a personal access token

    <Steps>
      <Step title="Open token settings">
        Go to GitHub **Settings** → **Developer settings** → **Personal access tokens** → **Tokens (classic)**.
      </Step>

      <Step title="Generate a new token">
        Click **Generate new token (classic)**, give it a name like *My Laptop*, select the `repo` scope, set an expiration, and click **Generate token**.
      </Step>

      <Step title="Copy it immediately">
        You will not see the token again after leaving the page. Save it somewhere secure.
      </Step>
    </Steps>

    <Warning>
      Never share your personal access token or commit it to a repository. Treat it exactly like a password.
    </Warning>

    ### Use your token when pushing

    ```bash theme={null}
    git push

    # GitHub will ask for:
    # Username: your-github-username
    # Password: paste-your-token-here  (NOT your GitHub password!)
    ```
  </Tab>

  <Tab title="SSH Keys">
    ### Generate an SSH key pair

    ```bash theme={null}
    ssh-keygen -t ed25519 -C "your_email@example.com"
    # Press Enter for all prompts to accept the defaults
    ```

    ### Add the key to your SSH agent

    <CodeGroup>
      ```bash macOS/Linux theme={null}
      eval "$(ssh-agent -s)"
      ssh-add ~/.ssh/id_ed25519
      ```

      ```bash Windows (Git Bash) theme={null}
      eval "$(ssh-agent -s)"
      ssh-add ~/.ssh/id_ed25519
      ```
    </CodeGroup>

    ### Copy your public key

    <CodeGroup>
      ```bash macOS theme={null}
      pbcopy < ~/.ssh/id_ed25519.pub
      ```

      ```bash Windows (Git Bash) theme={null}
      cat ~/.ssh/id_ed25519.pub | clip
      ```

      ```bash Linux theme={null}
      cat ~/.ssh/id_ed25519.pub
      # Manually copy the output
      ```
    </CodeGroup>

    ### Add the key to GitHub

    1. Go to [GitHub Settings → SSH Keys](https://github.com/settings/keys)
    2. Click **New SSH key**
    3. Give it a title (e.g., *My Laptop*) and paste your key
    4. Click **Add SSH key**

    ### Test the connection

    ```bash theme={null}
    ssh -T git@github.com
    # Expected: "Hi username! You've successfully authenticated..."
    ```

    <Tip>
      When using SSH, always clone with the SSH URL format: `git clone git@github.com:username/repo.git`
    </Tip>
  </Tab>
</Tabs>

## What's next?

Now that your account is configured, let's learn how to create your first repository and clone existing projects.

<Card title="Clone and create" icon="code-fork" href="/tools/git/clone-create">
  Start using GitHub with real repositories
</Card>
