Welcome to the Git 101 Workshop! This project is designed to teach Code Network members the fundamentals of using Git and GitHub for collaborative software development.
- Workshop Goal
- Project Description
- Prerequisites
- Choosing Your Git Tool
- Workshop Steps
- Alternative Workflows
- Useful Commands Reference
- Troubleshooting
- Contributing Guidelines
- Questions?
- Additional Resources
By the end of this workshop, you will learn how to:
- Fork a repository on GitHub
- Clone a repository to your local machine
- Make changes to code
- Stage and commit your changes
- Push changes to your remote repository
- Create a pull request to contribute to the original project
This is a simple C# console application that displays a welcome message and lists all the awesome coders who attended this workshop. Your task is to add your name to the attendees list!
Before starting, make sure you have:
- Git installed on your computer
- A GitHub account
- (Optional).NET 8.0 SDK installed (to run the program)
- A code editor (e.g., NotePad++, Visual Studio, VS Code, or Rider)
You have three main options for working with Git and GitHub. Choose the one that best fits your comfort level:
Quick Decision Guide:
- New to Git? → Start with GitHub Desktop (easiest to visualize)
- Want to learn Git deeply? → Use Git CLI (useful for advanced features)
- Want GitHub-specific features? → Try GitHub CLI (powerful shortcuts)
- Can't decide? → Git CLI is the most versatile and widely used
The traditional Git command-line tool. Best for understanding Git fundamentals.
Setup:
- Download and install from git-scm.com/install
- Open terminal/command prompt and verify installation:
git --version
- Configure your identity:
git config --global user.name "Your Name" git config --global user.email "your.email@example.com"
Best for: Learning Git fundamentals, available everywhere, most documentation uses this
GitHub's official CLI tool with enhanced GitHub integration.
Setup:
- Download from cli.github.com
- Install and verify:
gh --version
- Authenticate with GitHub:
Follow the prompts to connect to your GitHub account
gh auth login
Best for: Streamlined GitHub workflows, creating PRs from terminal, managing issues
A graphical application for Git and GitHub operations.
Setup:
- Download from desktop.github.com
- Install and open the application
- Sign in with your GitHub account
- Configure your Git settings in Options/Preferences
Best for: Visual learners, beginners who prefer GUIs, easy conflict resolution
- Navigate to the original repository on GitHub
- Click the "Fork" button in the top-right corner
- This creates a copy of the repository under your GitHub account
Note: If you're using GitHub CLI or GitHub Desktop, skip to the Alternative Workflows section below for tool-specific instructions.
Using Git CLI:
- On your forked repository page, click the green "Code" button
- Copy the URL (HTTPS or SSH)
- Open your terminal/command prompt
- Navigate to where you want to store the project
- Run the clone command:
git clone <your-fork-url>
cd git-101-2026- Open
Program.csin your code editor - Find the
attendeesarray (around line 1-6) - Add your name to the list, following the existing format:
string[] attendees =
[
"William Qu",
"Angus Wong",
"Your Name Here", // Add your name!
];- Save the file
Run the program to see your name in the list:
dotnet runNote: GitHub CLI and GitHub Desktop users, see Alternative Workflows for your specific steps.
Using Git CLI:
Stage the file you modified:
git add Program.csOr stage all changes:
git add .Check what's staged:
git statusCreate a commit with a descriptive message:
git commit -m "Add [Your Name] to attendees list"Push your changes to your forked repository on GitHub:
git push origin mainNote: GitHub CLI users can create PRs directly from the terminal - see Alternative Workflows.
Using Git CLI or GitHub Desktop:
- Go to your forked repository on GitHub
- You should see a prompt saying "Compare & pull request" - click it
- If not, click "Pull requests" tab, then "New pull request"
- Add a title and description for your pull request
- Click "Create pull request"
- Wait for the maintainer to review and merge your contribution!
If you chose GitHub CLI, here are the equivalent commands:
Fork the repository:
gh repo fork <original-repo-url> --clone
cd git-101-2026Stage, commit, and push:
git add Program.cs
git commit -m "Add [Your Name] to attendees list"
git push origin mainCreate a pull request:
gh pr create --title "Add [Your Name] to attendees list" --body "Adding my name to the workshop attendees list"View your pull request:
gh pr view --webIf you chose GitHub Desktop, follow these steps:
Fork and clone:
- Go to the original repository on GitHub website
- Click "Fork" button
- Open GitHub Desktop
- Go to File → Clone Repository
- Select your forked repository and choose a local path
- Click "Clone"
Make changes and commit:
- Make your changes to
Program.csin your code editor - GitHub Desktop will automatically detect changes
- Review changes in the "Changes" tab
- Enter a commit message in the summary field: "Add [Your Name] to attendees list"
- Click "Commit to main"
Push and create PR:
- Click "Push origin" button to push to your fork
- Click "Create Pull Request" button
- GitHub will open in your browser
- Fill in the PR details and click "Create pull request"
Here are some commands you'll find helpful:
git status # Check the status of your working directory
git log # View commit history
git diff # See what changes you've made
git branch # List branches
git checkout -b <name> # Create and switch to a new branch
git pull origin main # Get latest changes from remoteIf you're using GitHub CLI:
gh repo view # View repository details
gh pr list # List your pull requests
gh pr status # Check status of your PRs
gh pr checks # See PR check status
gh issue list # View issues
gh repo sync # Sync your fork with upstreamIn GitHub Desktop:
- View changes: Changes tab shows modified files
- View history: History tab shows commits
- Create branch: Branch menu → New Branch
- Switch branches: Click current branch dropdown
- Pull changes: Click "Fetch origin" then "Pull origin"
- View conflicts: Conflicted files show in Changes tab with "Open in editor" option
If someone else added their name in the same location, you might encounter a merge conflict. Don't worry!
Using Git CLI:
- Open the conflicted file in your editor
- Look for conflict markers (
<<<<<<<,=======,>>>>>>>) - Edit the file to keep both changes
- Remove the conflict markers
- Stage and commit the resolved file:
git add Program.cs git commit -m "Resolve merge conflict"
Using GitHub CLI: Same as Git CLI - GitHub CLI uses standard Git for conflict resolution
Using GitHub Desktop:
- GitHub Desktop will show conflicted files in the Changes tab
- Click "Open in [your editor]" on the conflicted file
- Edit to resolve conflicts and remove markers
- Save the file
- Return to GitHub Desktop - it will detect the resolution
- Click "Commit merge" to complete the resolution
If the original repository has new changes:
Using Git CLI:
# Add the original repository as a remote (one-time setup)
git remote add upstream <original-repo-url>
# Fetch and merge updates
git fetch upstream
git merge upstream/mainUsing GitHub CLI:
# Sync your fork with the original repository
gh repo syncUsing GitHub Desktop:
- Go to Branch menu → Merge into current branch
- Select "upstream/main" (you may need to add the upstream remote first)
- Or use Repository → Repository Settings → Remote to add upstream
- Then fetch and merge from Branch menu
- Use your real name or preferred name
- Be respectful and supportive of other learners
If you get stuck or have questions during the workshop, don't hesitate to ask the workshop facilitators or your fellow attendees. We're all here to learn!
Happy coding and welcome to the world of version control!