Goal: Learn how to use GitHub with Lovable for version control and collaboration
Estimated Time: 30-40 minutes
Prerequisites: Complete Modules 1-4 first
By the end of this module, you will:
- Understand what version control is and why it matters
- Know how to connect Lovable to GitHub
- Understand commits, branches, and pull requests
- Learn how to collaborate with others
- Know how to manage your code history
- Be able to use GitHub for backup and portfolio
Version control is like a time machine for your code. It:
- ✅ Saves every version of your project
- ✅ Lets you go back to any point
- ✅ Tracks all changes
- ✅ Enables collaboration
- ✅ Provides backup
Benefits:
- Backup - Your code is safe
- History - See how your project evolved
- Collaboration - Work with others
- Experimentation - Try things without fear
- Portfolio - Show your work
- Recovery - Get back lost work
GitHub is a platform for version control. Think of it as:
- Google Drive for code
- Time machine for projects
- Collaboration platform
- Portfolio showcase
💡 Beginner Tip: You don't need to understand all the technical details! Lovable makes it easy.
If you don't have one:
- Go to github.com
- Click "Sign up"
- Create a free account
- Verify your email
- In your Lovable project, go to Settings
- Find "GitHub" or "Version Control" section
- Click "Connect to GitHub"
- Authorize Lovable - Click "Authorize" or "Allow"
- Choose repository settings:
- Create new repository
- Or use existing one
- Choose public or private
- Save
Once connected:
- Code syncs automatically - Changes are saved to GitHub
- You can see it on GitHub - Visit github.com to view
- Others can see it - If public, people can view your work
💡 Beginner Tip: Start with a private repository if you're learning. Make it public later if you want to showcase it.
A commit is like saving a snapshot of your project at a specific point in time.
Think of it like:
- Saving a document
- Taking a photo
- Creating a checkpoint
Lovable automatically:
- ✅ Creates commits when you make changes
- ✅ Adds descriptive messages
- ✅ Saves to GitHub
- ✅ Keeps history organized
You can also:
- Create commits manually
- Add custom commit messages
- Control when commits happen
Good commit messages:
- Describe what changed
- Are clear and specific
- Help you understand history
Examples:
- "Add user authentication"
- "Fix contact form submission"
- "Update homepage design"
- "Add task filtering feature"
💡 Beginner Tip: Lovable creates good commit messages automatically. You can customize them if you want.
Branches are like parallel timelines. You can work on different features without affecting the main project.
Think of it like:
- Main branch = Published book
- Feature branch = Draft chapter
- You edit the draft, then merge it into the book
Use branches for:
- ✅ Trying new features
- ✅ Experimenting
- ✅ Working on big changes
- ✅ Collaborating with others
In Lovable:
Create a new branch called "feature-new-design" to work on redesigning the homepage
Or in GitHub:
- Go to your repository
- Click "main" branch dropdown
- Type new branch name
- Create branch
When you're done:
Merge the "feature-new-design" branch into main
Or in GitHub:
- Go to your repository
- Create a Pull Request
- Review changes
- Merge
💡 Beginner Tip: Start with just the main branch. Use branches when you're comfortable or working on big features.
A Pull Request (PR) is a way to:
- Review changes before merging
- Discuss changes with others
- Get feedback
- Merge branches safely
- Make changes in a branch
- Create Pull Request - Propose merging into main
- Review changes - See what's different
- Discuss - Comment and get feedback
- Merge - Combine into main branch
In GitHub:
- Go to your repository
- Click "Pull Requests" tab
- Click "New Pull Request"
- Choose branches to compare
- Add description
- Create PR
💡 Beginner Tip: Pull Requests are great for collaboration. Even solo, they help you review your own changes!
GitHub enables:
- Multiple people working on same project
- Reviewing each other's code
- Discussing changes
- Merging work together
- Clone repository - Get a copy
- Create branch - Work on feature
- Make changes - Build your feature
- Commit changes - Save your work
- Push to GitHub - Upload your changes
- Create Pull Request - Propose merging
- Review and merge - Combine into main
Showcase your work:
- Make repositories public
- Add README files
- Include screenshots
- Document your projects
- Share with employers/clients
💡 Beginner Tip: GitHub is like a portfolio for developers. Keep your best work public!
Task: Connect a project to GitHub and make your first commit.
Steps:
- Connect to GitHub (as described above)
- Make a small change to your project
- Check GitHub - See your change there
- View commit history - See the commit
Task: Create a branch and make changes.
Steps:
- Create a branch:
Create a new branch called "experiment-new-feature" - Make changes in that branch
- Check GitHub - See the branch
- Switch back to main - See it's unchanged
Task: Merge your experimental branch.
Steps:
- Go to GitHub
- Create Pull Request from your branch
- Review changes
- Merge into main
- See changes in main branch
Before completing the course, make sure you can:
- Understand what version control is
- Connect Lovable to GitHub
- Understand commits and commit messages
- Create and use branches
- Create and merge pull requests
- Use GitHub for backup
- Understand basic collaboration
A: It's optional but recommended! Great for backup and learning.
A: Yes! Free accounts have unlimited public repositories and some private ones.
A: Yes! Lovable handles most of it. You can use GitHub's web interface for the rest.
A: Git is the tool, GitHub is the platform. Lovable uses Git and connects to GitHub.
A: Private for personal projects, public for portfolio pieces you want to showcase.
Great work! You now understand version control with GitHub. Use it to backup your work and build your portfolio.
Continue with:
- Module 15: Deploying to Custom Clouds
- Or apply these skills to manage your projects!
Module 14 Complete! 🎉