Installation and Initial Setup
Before you can start contributing to CodeHarborHub projects, you need to turn your computer into a "Git-aware" machine. Follow the guide below for your specific Operating System.
Before we dive in, make sure you have a GitHub account set up. If you haven't done that, follow the instructions in Create a GitHub Account first, and then come back here to set up Git on your machine.
Step 1: Installing Git
- Windows
- macOS
- Linux
- Download: Visit git-scm.com/download/win and the download will start automatically.
- Run the Installer: Open the
.exefile. - The "CodeHarborHub" Recommended Settings:
- Editor: Choose "Visual Studio Code" as Git's default editor.
- Path: Select "Git from the command line and also from 3rd-party software."
- Line Endings: Select "Checkout Windows-style, commit Unix-style."
- Finish: Click Install.
- Check if installed: Open Terminal and type
git --version. macOS often comes with a version of Git pre-installed. - Install via Homebrew (Recommended):
brew install git - Alternative: Download the installer from git-scm.com/download/mac.
Use your distribution's package manager. For Ubuntu/Debian (the most common for CodeHarborHub learners):
sudo apt update
sudo apt install git-all -y
For Fedora:
sudo dnf install git
Step 2: Configuring Your Identity
This is the most important step! Git needs to know who you are so it can attach your name to your "Commits" (Save Points).
Use the same email address you used for your GitHub account. This ensures your contributions are linked to your profile!
Open your terminal (or Git Bash on Windows) and run these two commands:
# Set your professional name
git config --global user.name "ajay-dhangar"
# Set your GitHub email
git config --global user.email "ajay...@gmail.com"
Replace "ajay-dhangar" and "ajay...@gmail.com" with your actual name and email. This information will be visible in your commit history and on GitHub.
Step 3: Verifying the Setup
Let's make sure everything is working perfectly. Run the following command to see your configuration:
git config --list
What you should see:
Look for the user.name and user.email lines in the output. If they match what you typed, your "Developer Identity" is now live!
How the Setup Connects
Extra Credit: Essential "Helper" Tools
While you can do everything in the terminal, these tools make the CodeHarborHub experience much smoother:
- Visual Studio Code (VS Code): The #1 editor for developers. It has Git built right in!
- Git Lens (Extension): An extension for VS Code that shows you exactly who wrote every line of code as you click on it.
- GitHub Desktop: A simple visual interface if you aren't comfortable with the terminal yet.
If you are on Windows, always use Git Bash (which was installed with Git) instead of the standard Command Prompt. It gives you a Linux-like experience that matches all professional tutorials!