Git and GitHub Setup Journey
1. Creating a GitHub Account
Why GitHub?
GitHub is more than just a platform - it's a collaborative ecosystem for developers worldwide. It allows you to store, manage, and share code, track changes, and work with teams seamlessly.
Account Creation Steps
- Navigate to https://github.com/signup
- Choose your account type (typically "Personal")
- Select options that reflect your development goals
- Are you a student? Professional? Open-source contributor?
- Complete the registration process
- Use a professional email you'll remember
- Create a strong, unique password
- Use an email you'll consistently access
- Choose a username that represents your professional identity
- Consider using the same username across professional platforms
2. Organization Invitation Preparation
Communicating with Sean
- Have your GitHub username ready
- Prepare a professional email message:
Good Morning Sean,
I've created my GitHub account with the username [YOUR_USERNAME]
and would like to be added to the TravellingLanguages organization.
My professional email is [YOUR_EMAIL].
Could you please send me an invitation?
Best regards,
[Your Name] - send it to sf@tl.ie
Verifying Organization Access
- Visit https://github.com/settings/organizations
- Look for "TravellingLanguages" in your organization list
- Alternative verification: https://github.com/TravellingLanguages
- Wait for Sean to send the invitation
- Accept the invitation through the email link
- Confirm your membership in the organization
3. Git Installation
Understanding Git
Git is a distributed version control system that tracks changes in source code during software development. It allows multiple developers to work together efficiently.
Installation by Operating System
Windows: Multiple Installation Methods
Method 1: Browser Download
- Visit https://git-scm.com/download/win
- Download the installer
- Run the installer
- Choose "Use Git Bash" during installation
- Select "Recommended" settings for most options
Method 2: Command-Line Download using wget
If you prefer downloading directly via command line, follow these steps:
-
Open PowerShell as Administrator
- Press Windows Key
- Type "PowerShell"
- Right-click and select "Run as Administrator"
-
Download Git Installer
# Download 64-bit version
Invoke-WebRequest -Uri "https://github.com/git-for-windows/git/releases/download/v2.43.0.windows.1/Git-2.43.0-64-bit.exe" -OutFile "GitInstaller.exe" -
Verify Download Integrity
# Optional: Check file size to confirm download
(Get-Item "GitInstaller.exe").length -
Install Git
# Silent install (recommended for automated setups)
Start-Process -FilePath ".\GitInstaller.exe" -ArgumentList "/SILENT" -Wait -
Verify Installation
# Check Git version
git --version
- Always download from official sources
- Verify the exact version number at the time of installation
- 64-bit version recommended for most modern systems
Method 3: Chocolatey Package Manager (Alternative)
For those using Chocolatey:
choco install git
macOS
- Install via Homebrew:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install git
Linux (Ubuntu/Debian)
sudo apt update
sudo apt install git
Verifying Installation
git --version
4. GitHub CLI Authentication: A Deep Dive
Prerequisites
- Git installed
- GitHub account
- GitHub CLI installed
Installation of GitHub CLI
Windows
- Download from https://cli.github.com/
- Run the installer
- Follow installation wizard
macOS
brew install gh
Linux
# Ubuntu/Debian
sudo apt install gh
# Fedora
sudo dnf install gh
Authentication Process: The Comprehensive Walkthrough
Step 1: Initial Authentication
gh auth login
Interactive Prompt Breakdown
When you run gh auth login, you'll encounter an interactive wizard:
-
Host Selection
- Choose "GitHub.com"
- This connects to the main GitHub platform
-
You may be prompted this: Authenticate Git with your GitHub credentials? (Y/n)
- Choose "Y" to authenticate Git with your GitHub credentials
-
Authentication Method
- Select "Web Browser" (recommended)
- Provides the most secure and user-friendly experience
-
Browser-Based Authentication
- A browser window will open
- You'll see a unique code
- GitHub will ask you to enter this code
- Confirm your login
-
Scope Selection
- Choose "Entire account access"
- This allows full repository interactions
Verification
# Verify successful authentication
gh auth status
- Ensure pop-ups are enabled
- Check internet connectivity
- Refresh browser if code doesn't work
5. Git CLI: Essential Commands Tutorial
Basic Workflow Commands
Configuring Your Identity
# Set your username
git config --global user.name "Your Name"
# Set your email
git config --global user.email "your.email.used.for.github@example.com"
Repository Operations
# Create a new repository
git init
# Clone an existing repository
git clone https://github.com/username/repository.git
# Check repository status
git status
Tracking Changes
# Add files to staging
git add filename.txt # Single file
git add . # All changes
# Commit changes
git commit -m "Descriptive commit message"
Branching
# Create a new branch
git branch new-feature
# Switch to a branch
git checkout new-feature
# Create and switch in one command
git checkout -b another-feature
Synchronizing
# Pull latest changes
git pull origin main
# Push your changes
git push origin your-branch-name
Best Practices and Recommendations
- Always pull before you push
- Write clear, descriptive commit messages
- Use branches for new features
- Regularly update your local repositories
- Never commit sensitive information
- Never commit passwords or sensitive data
- Use
.gitignoreto prevent accidental commits - Be mindful of what you're pushing
Conclusion
This is a basic guide to setting up Git and GitHub for your development journey. Remember, practice makes perfect, so keep experimenting and learning. Happy coding!