Github Adding Collaborator Video: Adding Github Collaborator using VSCode and WSL
Here's a step-by-step guide to set up VS Code, Git, WSL, and GitHub CLI (gh) and push your first commit to GitHub.
This guide will help you:
✅ Install VS Code, Git, WSL (for Windows), and GitHub CLI (gh)
✅ Create a GitHub account & private repository
✅ Authenticate GitHub in VS Code
✅ Clone, commit, and push your files to GitHub
✅ Add collaborators (MAD-1, MAD-2)
1️⃣ Install VS Code:
👉 Download & Install VS Code
2️⃣ Install Git:
👉 Download & Install Git
3️⃣ Install WSL (Windows Subsystem for Linux)
Open PowerShell (Admin) and run:
wsl --installRestart your system.
4️⃣ Install GitHub CLI (gh)
Open WSL Terminal and run:
sudo apt update && sudo apt install gh -y(Note: gh command will also work in powershell, if you are struggling with wsl you can use powershell, you need to install choco and gh separately)
-
Open PowerShell as Administrator
- Search “PowerShell” in Start → Right-click → “Run as Administrator”
-
Run this command (force install Chocolatey):
Set-ExecutionPolicy Bypass -Scope Process -Force; ` [System.Net.ServicePointManager]::SecurityProtocol = ` [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; ` iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
-
Install
ghusing Chocolatey:choco install gh -y -
Verify installation:
gh --version
- Git & VS Code are pre-installed in most Linux/macOS systems.
- Install GitHub CLI (
gh) using:brew install gh # macOS sudo apt install gh -y # Linux
1️⃣ Open GitHub in your browser.
2️⃣ Sign up or log in to your account.
3️⃣ Click on "New Repository" and:
- Repository Name: Your Roll Number
- Visibility: Private
- Initialize with: ✅
README.md
1️⃣ Open VS Code
2️⃣ Open WSL Terminal (Windows) OR Powershell (Windows) OR Terminal (Mac/Linux)
- Shortcut: Ctrl + ` (tilde key)
- OR go to View → Terminal
3️⃣ Authenticate GitHub CLI in VS Code
gh auth login- Choose GitHub.com
- Choose HTTPS
- Copy the auth link shown in the terminal.
- Paste it into your browser and log in.
- After successful login, return to the terminal.
4️⃣ Clone the repository from GitHub
git clone "your_repo_link"- Get this repo link from GitHub → Code → Clone → HTTPS
- Example:
git clone https://github.com/your-username/your-repo.git
- Change directory to the repo:
cd your-repo
1️⃣ Create a new file inside your repo folder
Example:
touch example.txt
echo "This is my first GitHub file" > example.txt2️⃣ Stage the file (Add to Git)
git add example.txt3️⃣ Commit the changes with a message
git commit -m "Added example.txt"NOTE: if you get error that says "who are you ?" you have to add your name and email locally as well, the command for that is:
git config user.name "Your Name"
git config user.email "your.email@example.com"
4️⃣ Check status
git status5️⃣ Push changes to GitHub
git push origin main(Replace main with your branch if it's different.)
1️⃣ Go to GitHub → Your Repository
2️⃣ Check if your new file (example.txt) is uploaded.
3️⃣ If the file is there, your push was successful! ✅
1️⃣ Open your repository on GitHub
2️⃣ Go to Settings → Manage Access
3️⃣ Click on Invite Collaborators
4️⃣ Add users: Type in the official username of App Dev
- For MAD I, type MADI-cs2003
- For MAD II, type MADII-cs2006
5️⃣ Send collaboration invites and wait for them to accept.