How to Install GitHub

GitHub is a platform for hosting and managing code using Git. To use GitHub, you need to install Git and optionally GitHub Desktop for an easier interface.

1. Install Git

Git is required to work with GitHub repositories.

Windows:
  1. Download Git from the official website: https://git-scm.com/
  2. Run the installer and follow the setup instructions.
  3. Choose default options unless you need specific configurations.
  4. Open Command Prompt or Git Bash and type:
    sh
    git --version

    This should display the installed Git version.

Mac:
  1. Open Terminal and type:
    sh
    git --version

    If Git is not installed, macOS will prompt you to install it.

  2. Alternatively, install Git via Homebrew:
    sh
    brew install git
Linux (Ubuntu/Debian):
  1. Open Terminal and run:
    sh
    sudo apt update

    sudo apt install git
  2. Verify the installation with:
    sh
    git --version

2. Install GitHub Desktop (Optional)

For users who prefer a graphical interface:

  1. Download GitHub Desktop from https://desktop.github.com/.
  2. Install it by following on-screen instructions.
  3. Sign in with your GitHub account.

3. Set Up GitHub

  1. Open a terminal or Git Bash.
  2. Configure Git with your name and email:
    sh
    git config --global user.name "Your Name"

    git config --global user.email "[email protected]"
  3. Authenticate with GitHub using SSH or HTTPS (recommended for private repositories).

4. Clone a Repository (Example)

To download a repository:

sh
git clone https://github.com/username/repository.git

5. Create a Repository and Push Code

  1. Create a new repository on GitHub.
  2. In your local folder, initialize Git:
    sh
    git init
  3. Add files and commit changes:
    sh
    git add .

    git commit -m "Initial commit"
  4. Link to GitHub and push:
    sh
    git remote add origin https://github.com/username/repository.git

    git push -u origin main

That’s it! You’ve installed GitHub and set up Git. 🚀

Scroll to Top