Overview
GitHub Desktop provides multiple ways to work with repositories, whether you’re cloning from GitHub, adding existing local repositories, or creating new ones from scratch.Clone Repository
Clone repositories from GitHub, GitHub Enterprise, or any Git URL
Add Existing
Add repositories that already exist on your computer
Create New
Initialize new Git repositories with a single click
Multi-Repository
Manage multiple repositories and switch between them easily
Cloning Repositories
Clone from GitHub
GitHub Desktop integrates directly with your GitHub account to make cloning seamless:Access Clone Dialog
Click File > Clone Repository or press
Ctrl+Shift+O (Windows/Linux) or Cmd+Shift+O (macOS)Select Repository
Choose from repositories you have access to:
- Your repositories
- Organization repositories
- Repositories you’ve starred
Clone from URL
Clone any Git repository using its URL:GitHub Desktop automatically clones repositories recursively, including all submodules with the
--recursive flag.Clone Implementation Details
GitHub Desktop’s clone operation includes several advanced features:- Progress Tracking: Real-time progress updates during cloning
- LFS Support: Automatically tracks Git LFS progress
- Default Branch: Respects custom default branch names
- Branch Selection: Clone specific branches with
-boption - Submodules: Recursive submodule initialization
Adding Existing Repositories
Add repositories that already exist on your local machine:Creating New Repositories
Initialize a new Git repository from scratch:Configure Repository
- Name: Enter the repository name
- Description: Add an optional description
- Local Path: Choose where to create the repository
- Git Ignore: Select a template for
.gitignore - License: Choose an open-source license (optional)
Managing Multiple Repositories
Switching Between Repositories
GitHub Desktop makes it easy to work with multiple repositories:- Click the Current Repository dropdown in the toolbar
- Search or browse your repository list
- Click a repository to switch to it
- Use
Ctrl+T(Windows/Linux) orCmd+T(macOS) for quick switching
Repository List Organization
Repositories are organized by:- Recent: Most recently accessed repositories appear first
- Groups: Repositories can be grouped (GitHub.com, Enterprise, etc.)
- Search: Filter repositories by name instantly
Removing Repositories
Remove a repository from GitHub Desktop:Repository State
GitHub Desktop maintains state for each repository:- Working Directory Status: Tracks file changes
- Branch Information: Current branch and upstream tracking
- Commit History: Local and remote commit history
- Remote Configuration: Remote URLs and fetch settings
- Stash Entries: Saved work-in-progress changes
Opening in External Applications
Open in File Manager
- Windows: Right-click repository > Show in Explorer
- macOS: Right-click repository > Show in Finder
- Linux: Right-click repository > Show in File Manager
Open in External Editor
Configure your preferred editor in Preferences > Integrations, then:- Click Repository > Open in [Editor]
- Or press
Ctrl+Shift+A(Windows/Linux) orCmd+Shift+A(macOS)
Open in Terminal
Open a terminal/command prompt in the repository directory:- Click Repository > Open in Terminal
- Or press
Ctrl+`` (Windows/Linux) orCmd+“ (macOS)
Repository Settings
Access repository-specific settings:Remote Settings
Remote Settings
Configure remote URLs and fetch behavior:
- Primary remote URL
- Fork remotes for pull requests
- Fetch interval settings
Git Config
Git Config
Repository-specific Git configuration:
- User name and email for commits
- Line ending preferences
- Git LFS settings
Ignored Files
Ignored Files
Manage
.gitignore patterns:- Edit
.gitignorefile - Add patterns to exclude files
- View ignored files
Best Practices
- Clone to Consistent Location: Keep all repositories in a dedicated folder (e.g.,
~/ProjectsorC:\Users\[Name]\Projects) - Use Descriptive Names: Choose clear, descriptive names when creating repositories
- Regular Cleanup: Remove repositories you’re no longer using from the list
- Backup Important Work: Ensure repositories are pushed to a remote backup regularly
- Check Disk Space: Monitor disk space when cloning large repositories
Troubleshooting
Clone Failures
Authentication Failed
Authentication Failed
If cloning fails due to authentication:
- Verify your GitHub account is connected in File > Options > Accounts
- Check if you have access to the repository
- For private repos, ensure your token has the correct permissions
Network Errors
Network Errors
If cloning fails due to network issues:
- Check your internet connection
- Verify any proxy settings in File > Options > Advanced
- Try cloning via HTTPS instead of SSH, or vice versa
Path Too Long (Windows)
Path Too Long (Windows)
If you encounter “path too long” errors:
- Clone to a shorter path (e.g.,
C:\Git\repo-name) - Enable long paths in Windows:
git config --system core.longpaths true
Repository Not Detected
If a folder isn’t recognized as a Git repository:- Verify the
.gitfolder exists in the root directory - Check that the
.gitfolder wasn’t corrupted - Try running
git statusin the terminal to verify Git can access it - Consider re-cloning if the repository is corrupted