What is Git?
Git is a version control system that tracks changes to your code. HelloLeo uses Git to:- Track changes - See what Leo modified
- Version history - View past versions of your project
- Collaborate - Work with others on the same project
- Backup - Keep your code safe
Prerequisites: SSH Key Setup
Before connecting a Git repository, you need to set up an SSH key. This allows HelloLeo to authenticate with your Git provider (GitHub, GitLab, etc.).Step 1: Generate Your SSH Key
- Go to your Account Settings page
- Find the “Public SSH Key” section
- Click “Generate your Leo’s SSH Key”
- Once generated, click “Copy your Leo’s Public SSH Key”
Step 2: Add SSH Key to Your Git Provider
After copying your SSH key, add it to your Git provider: For GitHub:- Go to GitHub Settings > SSH and GPG keys
- Click “New SSH key”
- Paste your public key
- Click “Add SSH key”
- Go to GitLab Settings > SSH Keys
- Paste your public key in the “Key” field
- Add a title (e.g., “HelloLeo”)
- Click “Add key”
- Check your provider’s documentation for adding SSH keys
- The process is usually similar: Settings → SSH Keys → Add new key
Step 3: Verify Setup
Once your SSH key is added to your Git provider, you’re ready to connect repositories!Repository Connection
Connect Existing Repository
- Go to Project Settings
- Enter your Git repository URL (SSH format:
git@github.com:user/repo.git) - HelloLeo will clone and connect your repository
Create New Repository
If you don’t have a repository yet:- Create a project in HelloLeo
- Leo will initialize Git automatically
- Connect to GitHub/GitLab later if needed
Git Operations
Change Branch
Switch between different branches of your code:- Select branch - Choose from existing branches
- Create new branch - Start a new feature branch
- See branch status - Know which branch you’re on
Connect Repository
Link your project to a Git repository:- Enter SSH URL - Use format:
git@github.com:user/repo.git - Test connection - Verify credentials work
- Sync automatically - Changes sync with your repo
Sync Status
See if your local code matches the remote:- Up to date - Everything is synced
- Ahead - You have local changes to push
- Behind - Remote has changes to pull
Version History
View recent commits:- See changes - What was modified
- View dates - When changes were made
- Navigate versions - Go back to previous versions
Understanding Git Terms
- Branch - A separate line of development
- Commit - A saved change to your code
- Push - Send changes to remote repository
- Pull - Get changes from remote repository
- Remote - The repository stored on GitHub/GitLab/etc.
Best Practices
- Regular commits - Leo commits changes automatically
- Use branches - Test features in separate branches
- Sync regularly - Keep local and remote in sync
- Review changes - Check what Leo modified
Troubleshooting
Connection Issues
- Check SSH URL - Must be in SSH format (
git@github.com:user/repo.git) - Verify SSH key is set up - Make sure you’ve generated your SSH key on the Account Settings page and added it to your Git provider
- Check Git provider - Ensure the SSH key is correctly added to GitHub/GitLab
- Test connection - Use the test button in Project Settings
Sync Problems
- Pull first - Get remote changes before pushing
- Resolve conflicts - Merge conflicts if they occur
- Check branch - Make sure you’re on the right branch
