๐Ÿ“ Git & GitHub

Adding an Existing Project to GitHub Desktop ๐Ÿ“

P
Author
PyLand Team
๐Ÿ“…
Published
06.05.2026
โฑ๏ธ
Reading time
3 min
๐Ÿ‘๏ธ
Views
504
๐ŸŒฑ
Level
Beginner

Got a folder with code on your computer and want to start using Git? Here’s how to add a local project to GitHub Desktop.

When Do You Need This?

  • You have a folder with code that isn’t a Git repository yet
  • You cloned a project through the terminal and want to open it in a GUI
  • You received an archive of a project from a colleague
  • You were working on a project without Git and decided to start versioning

Option 1: Add an Existing Git Repository

If the folder is already a Git repository (has a .git folder):

Steps:

  1. Open GitHub Desktop
  2. File โ†’ Add Local Repository
  3. Click Choose… and select the folder
  4. Click Add Repository

โœ… Done! The repository appears in GitHub Desktop.

What you’ll see:

  • Commit history in the History tab
  • Current changes in Changes (if any)
  • Current branch in the header

Option 2: Initialize a New Repository

If the folder is not a Git repository:

Steps:

  1. File โ†’ Add Local Repository
  2. Select the folder with your project
  3. You’ll see an error: “This directory does not appear to be a Git repository”
  4. Click Initialize Git Repository or create a repository

GitHub Desktop will create a .git folder automatically!

After initialization:

  1. All files appear in Changes (untracked)
  2. Make the first commit:
    - Summary: Initial commit
    - Click Commit to main

Option 3: Create a New Repository from Scratch

If the project doesn’t exist yet:

Steps:

  1. File โ†’ New Repository
  2. Fill in:
    - Name: project name
    - Description: brief description
    - Local Path: where to create it
    - โœ… Initialize this repository with a README
    - Git Ignore: choose a template (Python, Node, Java…)
    - License: choose a license (optional)
  3. Create Repository

GitHub Desktop will create the folder and initialize Git!

Understanding the GitHub Desktop Interface

Left panel: Changes

Shows modified files:

โœ“ new_file.py        (green +)
โœ“ modified.js        (yellow dot)
โœ“ deleted.txt        (red -)

Checkboxes โ€” files that will be included in the commit.
Uncheck a file to exclude it from the commit.

Right panel: Diff

Shows exactly what changed:

function hello() {
-  console.log("Hello");
+  console.log("Hello World!");
}
  • Red lines (- minus) โ€” removed
  • Green lines (+ plus) โ€” added

Bottom section: Commit

Two fields:

  1. Summary โ€” short description (required)
  2. Description โ€” details (optional)

Common Tasks

Open project in editor

  1. Repository โ†’ Open in Visual Studio Code (or another editor)
  2. Or: Ctrl+Shift+A (Windows) / Cmd+Shift+A (Mac)

Open folder in file explorer

  1. Repository โ†’ Show in Explorer (Windows)
  2. Or: Repository โ†’ Show in Finder (Mac)
  3. Or: Ctrl+Shift+F / Cmd+Shift+F

Open terminal in project folder

  1. Repository โ†’ Open in Terminal
  2. Or: Ctrl+** (Windows) / **Cmd+ (Mac)

Setting Up .gitignore

After adding a project you’ll often need to configure .gitignore:

What is it?

The .gitignore file tells Git which files NOT to track:

  • Dependencies (node_modules/, venv/)
  • Builds (dist/, build/, *.pyc)
  • Configs (.env, .idea/, .vscode/)
  • System files (.DS_Store, Thumbs.db)

How to add:

  1. Repository โ†’ Repository Settings โ†’ Ignored Files
  2. Or create a .gitignore file in the project root

Template examples:

Python:

__pycache__/
*.py[cod]
venv/
.env

Node.js:

node_modules/
.npm
.env
dist/

General:

.DS_Store
.idea/
.vscode/
*.log

Troubleshooting

“This directory appears to be a Git repository”

The folder is already a Git repository! Just:
- File โ†’ Add Local Repository (don’t create a new one!)

“The repository is missing or not accessible”

Check:
- Is the path correct?
- Do you have access rights to the folder?
- Did you delete the .git folder?

Too many untracked files

Set up .gitignore before the first commit:

  1. Add .gitignore with the necessary patterns
  2. Remove unwanted files from Changes
  3. Make a commit

Example: Adding a Python Project

# You have a project
my-python-app/
โ”œโ”€โ”€ app.py
โ”œโ”€โ”€ requirements.txt
โ””โ”€โ”€ venv/              # NOT needed in Git!

Steps:

  1. Open GitHub Desktop
  2. File โ†’ Add Local Repository
  3. Select my-python-app/
  4. Click create a repository
  5. Create .gitignore:
    venv/ __pycache__/ *.pyc .env
  6. Only app.py and requirements.txt remain in Changes
  7. Make a commit: Initial commit

โœ… Done! Project is under Git!

What’s Next?

After adding the project:

  1. โœ… Publish on GitHub (Publish repository)
  2. โœ… Set up .gitignore
  3. โœ… Make commits when changes happen
  4. โœ… Create branches for new features

Your project is now safely under Git! ๐Ÿš€

Your reaction to the article

๐Ÿ’ฌ Comments (0)

๐Ÿ” Sign in to leave a comment
๐Ÿšช Login
๐Ÿ’ญ

No comments yet

Be the first to share your opinion about this article!

๐Ÿ”— Similar

Similar articles

Continue learning with these materials

๐Ÿ“

Undo and Revert in GitHub Desktop: Fix Mistakes Wโ€ฆ

A commit is not a point of no return. GitHub Desktop lets you rebuild a...

๐Ÿ“… 16.07.2026 ๐Ÿ‘๏ธ 359
๐Ÿ“

History, Diffs, and Web Commits on GitHub

GitHub lets you read repository history, inspect individual commit diffs, view the history of one...

๐Ÿ“… 16.07.2026 ๐Ÿ‘๏ธ 312
๐Ÿ“

Your First Git Commit

Your first commit starts with initializing a repository, configuring the author identity, and selecting the...

๐Ÿ“… 30.06.2026 ๐Ÿ‘๏ธ 343
๐ŸŽ“ Continue learning

Courses that cover this material

Visit the course to apply this material in practice.

Git & GitHub Desktop: Teamwork Without the Pain Open course curriculum