Updating a Repository
The core cycle: Clone, Edit, Commit, Push
π₯ Step A: Cloning (Remote to Local)
First, you need to download your remote repository to your computer.
Start Remote
On your GitHub repo page, click the green Code button.
Open with GitHub Desktop
Click "Open with GitHub Desktop".
Choose the local file path for the repository folder.
Clone via VS Code (two methods)
Open a new window, click "Clone Git Repository", and follow the prompts, OR:
- Copy the HTTPS URL shown after clicking the Code button
- In VS Code, open the Command Palette (
Ctrl/Cmd + Shift + P) - Type "Git: Clone" and press Enter
- Paste the URL and select a folder
Best of Both Worlds
- Follow the "Open with GitHub Desktop" prompts to create the local folder
- Then open this folder as a workspace in VS Code
βοΈ Step B: The Edit Cycle
Edit Files
Edit files in your local folder using any text/file editor.
Verify Changes
Open GitHub Desktop and verify changes are listed in the left panel.
Commit
Type a summary describing your changes and click Commit to main.
- "Add navigation menu"
- "Fix typo in README"
- "Update styling for mobile"
Push
Click Push origin (top toolbar) to upload your changes to GitHub.
Open as Workspace
Go to File β Open Folder... and select your repository folder.
Make Changes & Save
Edit your files and save them (Ctrl/Cmd + S), or enable Auto Save.
Open Source Control
Click the Source Control icon (branch logo) in the Activity Bar.
Stage Changes
Hover over the file name and click the + icon to stage it (or skip this to stage all at once).
Commit
Type a message in the text box and click Commit (or Ctrl/Cmd + Enter).
- "Add navigation menu"
- "Fix typo in README"
- "Update styling for mobile"
Sync
Click Sync Changes to Push to your remote repository.
πΊοΈ The Complete Workflow
β¨ Try It Now!
In your Sandbox repo, create a text file named hello.txt. Add the text "Hello World," save it, and push it to GitHub using either method above. Verify you can see it on the website!