Skip to content

Syoko3/ACMworkshop

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ACM Git Workshop: Professional Workflow in Action

Welcome! This is a hands-on workshop where you'll practice real Git workflows used in industry: branching, pull requests, code reviews, and shared code.

What You'll Learn

  • Create feature branches
  • Open and review pull requests
  • Work with a shared codebase flow

Prerequisites

Before the workshop, make sure you have:

1. Git Installed

Check if you have Git:

git --version

If not installed:

  • macOS: Open Terminal and run git --version (it will prompt you to install)
  • Windows: Download from git-scm.com
  • Linux: Run sudo apt-get install git (Ubuntu/Debian) or sudo yum install git (Fedora)

2. Node.js Installed

Check if you have Node.js:

node --version

If not installed:

  • All platforms: Download from nodejs.org (get the LTS version - the green button)
  • Run the installer, click through with default options
  • Close and reopen your terminal

Verify it worked:

node --version
npm --version

You should see version numbers like v20.x.x and 10.x.x.

3. GitHub Account

If you don't have one, create a free account at github.com.

4. Git Credentials Set Up

Run these commands with your info:

git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"

Setup (Do This First)

Important: Do not push directly to this repository. Fork the repo, create a feature branch, push to your fork, and open a pull request.

1. Fork and Clone

  1. Fork this repository to your GitHub account (click the "Fork" button in the top right).
  2. Clone your fork to your computer:
# Replace '<your-github-username>' with your actual GitHub username
git clone https://github.com/<your-github-username>/ACMworkshop.git
cd ACMworkshop

2. Configure Upstream

You need to tell Git where the original repository is so you can pull updates:

git remote add upstream https://github.com/chanu1406/ACMworkshop.git

3. Test the App

npm start

You should see the app run successfully. This confirms everything works!


Workshop Instructions

Step 1: Create Your Feature Branch

Pick a descriptive branch name:

git checkout -b feature/your-name-add-contributor

Example: feature/chanu-add-file

Step 2: Add Your Contribution

We avoid modifying existing files to prevent merge conflicts (when two people change the same line).

  1. Navigate to src/contributors/
  2. Create a new file named your-username.js.
  3. Add a simple log message inside:
    console.log("Hello from [Your Name]!");

Step 3: Commit and Push

# Add your new file
git add src/contributors/your-username.js

# Commit
git commit -m "Add contributor file for [your name]"

# Push
git push origin feature/your-branch-name

Step 4: Open a Pull Request

  1. Go to your fork on GitHub: https://github.com/<your-username>/ACMworkshop
  2. You should see a banner saying "Compare & pull request". Click it.
    • If you don't see the banner: Go to "Pull requests" tab -> "New pull request" -> click "compare across forks" -> select "chanu1406/ACMworkshop" as base and your fork as head.
  3. Fill out:
    • Title: Brief description of your change
    • Description: Why you made this change
  4. Click "Create pull request"

Step 5: Review Someone Else's PR

Your instructor will assign you a PR to review.

What to do:

  1. Go to the original repository PR list: https://github.com/chanu1406/ACMworkshop/pulls
  2. Click on the PR assigned to you (or pick a random one if not assigned).
  3. Click on "Files changed"
  4. Leave at least one comment:
    • Ask a question
    • Suggest an improvement
    • Approve the change
  5. Click "Review changes""Approve" or "Request changes"

Your review must include:

  • At least one written comment
  • One approval OR one request for changes

Your PR is now ready to merge!


Key Takeaways

  • Forks allow you to work on your own copy
  • Branches keep your work isolated
  • Pull requests are how you propose changes
  • Code Review ensures quality before merging

Common Commands

# See what branch you're on
git branch

# See what files changed
git status

# See your changes
git diff

# Switch branches
git checkout branch-name

# Get latest from the original repo
git pull upstream main

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%