Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ Quick Git & GitHub with VS Code Tutorial

This repo is a simple HTML/CSS/JS project to help you practice using Git and GitHub inside VS Code.
Follow the steps below to learn the essential workflow: clone β†’ edit β†’ commit β†’ branch β†’ push β†’ pull request β†’ merge.


1. Setup

  • Install Git.
  • Install VS Code.
  • In VS Code, install the extension:
    • GitHub Pull Requests and Issues

2. Clone the Repo

  1. Copy the URL of this repository.
  2. In VS Code:
    • Open the Command Palette (Ctrl+Shift+P / Cmd+Shift+P).
    • Run: Git: Clone β†’ paste the repo URL.
    • Open the cloned folder in VS Code.

3. Explore & Edit

  • Open index.html or style.css.
  • Make a small change, like updating the heading in index.html:
<h1>Hello World</h1>

➑ Change to:

<h1>Hello Git!</h1>

Or tweak a CSS color in style.css.


4. Stage & Commit

  1. Go to the Source Control tab in VS Code (left sidebar, Git icon).
  2. You’ll see your changed files.
  3. Hover over them and click + to Stage Changes.
  4. Enter a commit message (e.g., Updated heading text).
  5. Click βœ” Commit.

5. Create & Switch Branches

  • Open the Command Palette β†’ run: Git: Create Branch.
  • Name it something like feature-update.
  • Make another small change (e.g., change a button color in CSS).
  • Commit again with a message like: Changed button background color.

6. Push to GitHub

  • Click the Sync Changes button (↑↓) in the Source Control tab.
  • This uploads your commits and branch to GitHub.

7. Open a Pull Request (PR)

  1. Go to the repository on GitHub in your browser.
  2. You’ll see a banner to create a Pull Request from your new branch.
  3. Click Compare & pull request.
  4. Add a description and click Create pull request.

8. Merge the PR

  • On GitHub, review your changes in the PR.
  • Click Merge pull request β†’ Confirm merge.
  • Back in VS Code, click Sync Changes so your local main matches GitHub.

9. Bonus Tips (Optional)

  • Run git log in the VS Code terminal to see commit history.
  • Right-click a changed file β†’ Discard Changes to undo edits.
  • Add files to .gitignore to stop them being tracked.

βœ… You’ve now practiced the full GitHub workflow: Clone β†’ Edit β†’ Commit β†’ Branch β†’ Push β†’ Pull Request β†’ Merge β†’ Sync


Happy coding! πŸŽ‰


Do you want me to also generate a **starter repo scaffold** (basic `index.html`, `style.css`, `script.js`) that matches the tutorial, so learners can immediately follow along?

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages