Skip to content

Latest commit

 

History

History
276 lines (200 loc) · 8.66 KB

File metadata and controls

276 lines (200 loc) · 8.66 KB

🖱️ GitHub Desktop Guide

Welcome to the GitHub Desktop guide! This tool makes Git and GitHub super easy with a beautiful graphical interface.

🎯 What You'll Learn

  • ✅ How to install and set up GitHub Desktop
  • ✅ How to clone repositories with one click
  • ✅ How to make commits and push changes visually
  • ✅ How to sync with remote repositories
  • ✅ How to handle common Git tasks without command line

🤔 Why GitHub Desktop?

Perfect for Beginners 👶

  • Visual Interface: See your changes clearly
  • No Command Line: Point and click instead of typing commands
  • Error Prevention: Harder to make mistakes
  • Built-in Tutorials: Learn as you go

Still Powerful 💪

  • All Git Features: Everything you need for the course
  • Professional Tool: Used by many developers
  • Easy Collaboration: Share code with classmates effortlessly

📥 Step 1: Download and Install

Download GitHub Desktop

  1. Go to: desktop.github.com
  2. Click: "Download for [Your OS]"
  3. Install: Run the downloaded file with default settings

Supported Operating Systems:

  • ✅ Windows 10/11
  • ✅ macOS 10.15+
  • ❌ Linux (not officially supported - use command line Git)

🔑 Step 2: Sign In and Setup

First Launch

  1. Open: GitHub Desktop
  2. Sign In: Click "Sign in to GitHub.com"
  3. Browser Opens: Complete authentication in your web browser
  4. Return: Switch back to GitHub Desktop

Configure Git

GitHub Desktop will ask for:

  • Name: Your full name (for commit attribution)
  • Email: Use the same email as your GitHub account

Privacy Settings

  • Help improve GitHub Desktop: Choose based on your preference
  • Usage data: Optional - helps GitHub improve the app

🍴 Step 3: Fork and Clone the Course Repository

Fork the Repository (One-time setup)

  1. Go to: github.com/harshalmore31/cdac_python
  2. Click: "Fork" button (top-right)
  3. Create fork: Keep default settings and click "Create fork"

Clone Your Fork

  1. In GitHub Desktop: File → Clone a repository from the Internet
  2. Or: Click "Clone a repository from the Internet" on welcome screen
  3. Choose: "GitHub.com" tab
  4. Find: Your forked repository (should be YOUR_USERNAME/cdac_python)
  5. Choose Location: Select where to save on your computer
  6. Clone: Click "Clone"

Success! 🎉

You now have a local copy of the repository on your computer!


📝 Step 4: Daily Workflow - Making Changes

Open Your Project

  1. In GitHub Desktop: Current Repository → Choose your cdac_python
  2. Open in VSCode: Repository → Open in Visual Studio Code
  3. Or: Repository → Show in Explorer/Finder

Make Your Changes

  1. Navigate: Go to assignment_submission/Python_Day_X/
  2. Create File: Make your assignment file (e.g., your_name_q1.py)
  3. Write Code: Complete your assignment
  4. Save: Save your file (Ctrl+S in VSCode)

See Your Changes in GitHub Desktop

  1. Switch: Back to GitHub Desktop
  2. Changes Tab: You'll see your new/modified files listed
  3. Diff View: Click a file to see exactly what changed (green = added, red = removed)

💾 Step 5: Commit Your Changes

What is a Commit?

Think of a commit as taking a "snapshot" of your work at a specific point in time.

How to Commit

  1. Review Changes: Make sure all your files are listed
  2. Summary: Add a short description (e.g., "Completed Day 1 Assignment Q1")
  3. Description (optional): Add more details about what you did
  4. Commit: Click "Commit to main"

Good Commit Message Examples:

  • ✅ "Completed Day 1 Assignment Q1 - Number table program"
  • ✅ "Fixed bug in Day 2 Q3 - List sorting"
  • ✅ "Added comments to Day 1 solutions"
  • ❌ "stuff" (not descriptive)
  • ❌ "asdf" (not helpful)

🚀 Step 6: Push to GitHub

What is Pushing?

Pushing uploads your local commits to GitHub so others can see your work.

How to Push

  1. After Committing: You'll see "Push origin" button
  2. Click: "Push origin"
  3. Wait: GitHub Desktop uploads your changes
  4. Success: Your changes are now on GitHub!

View on GitHub

  1. Repository: Repository → View on GitHub
  2. Check: Your changes should be visible on github.com

🔄 Step 7: Stay Updated (Sync Changes)

When to Sync

When Harshal adds new course content or fixes, you'll want to get those updates.

How to Sync

  1. Check for Updates: Branch → "Merge into current branch"
  2. Choose Upstream: Look for "upstream/main" in the list
  3. Merge: Click to merge Harshal's updates into your fork
  4. Push: Push the merged changes to your GitHub fork

Alternative Method

  1. Repository: Repository → Repository Settings
  2. Remote: Add upstream remote: https://github.com/harshalmore31/cdac_python.git
  3. Fetch: Branch → Fetch and merge from upstream

🗂️ Understanding the Interface

Main Areas

Left Sidebar:

  • Changes: Files you've modified
  • History: Past commits

Center Panel:

  • Diff View: Shows exactly what changed in each file
  • File List: All modified files

Top Bar:

  • Current Repository: Switch between repositories
  • Current Branch: Usually "main" for this course
  • Fetch/Push: Sync with GitHub

Key Buttons:

  • 📥 Fetch origin: Check for new changes from GitHub
  • 🚀 Push origin: Upload your changes to GitHub
  • 🔄 Pull origin: Download changes from GitHub
  • 📋 Commit: Save your changes with a message

💡 Pro Tips for GitHub Desktop

Efficiency Tips:

  1. Keyboard Shortcuts:

    • Ctrl+Shift+A: Open in VSCode
    • Ctrl+Shift+F: Open in File Explorer
    • Ctrl+Enter: Commit changes
    • Ctrl+P: Push to origin
  2. Commit Often: Small, frequent commits are better than large ones

  3. Descriptive Messages: Your future self will thank you!

  4. Review Before Committing: Always check the diff to make sure you're committing what you intend

Organization Tips:

  1. One Feature Per Commit: Don't mix multiple assignments in one commit
  2. Check File Status: Make sure you're not committing unnecessary files
  3. Use .gitignore: Ignore temporary files (GitHub Desktop handles this automatically)

🆘 Common Issues and Solutions

"Repository not found"

  • Cause: You might be looking at the original repo instead of your fork
  • Solution: Make sure you forked the repository first, then clone YOUR fork

"Authentication failed"

  • Cause: GitHub Desktop lost connection to your account
  • Solution: File → Options → Accounts → Sign out and sign back in

"Merge conflicts"

  • Cause: You and Harshal modified the same file
  • Solution: GitHub Desktop will guide you through resolving conflicts

"Push rejected"

  • Cause: Someone else (usually Harshal) made changes since your last pull
  • Solution: Fetch and merge first, then push again

"Can't see my changes on GitHub"

  • Cause: You committed but didn't push
  • Solution: Click "Push origin" to upload your commits

🎓 Learning Path

Week 1: Basics

  • ✅ Install and setup GitHub Desktop
  • ✅ Fork and clone the repository
  • ✅ Make your first commit and push

Week 2: Workflow

  • ✅ Develop a rhythm: code → commit → push
  • ✅ Write better commit messages
  • ✅ Learn to sync with upstream changes

Week 3: Advanced

  • ✅ Understand branching (if needed for advanced assignments)
  • ✅ Learn to resolve simple merge conflicts
  • ✅ Explore history and diff views

🎉 Congratulations!

You're now ready to use GitHub Desktop like a pro! 🎊

What you've mastered:

  • ✅ Installing and configuring GitHub Desktop
  • ✅ Forking and cloning repositories
  • ✅ Making commits with descriptive messages
  • ✅ Pushing changes to GitHub
  • ✅ Syncing with repository updates
  • ✅ Understanding the GitHub Desktop interface

Next Steps:

  1. Practice: Use this workflow for all your assignments
  2. Explore: Try other GitHub Desktop features as you get comfortable
  3. Learn: Consider learning command line Git later for advanced features
  4. Help Others: Share your knowledge with classmates!

📚 Additional Resources


🎯 Remember: GitHub Desktop makes Git friendly and visual. Don't be afraid to experiment - you can always undo changes or ask for help!