Back to Tutorials
20 min
Intermediate
Using Version Control and Branching
Manage your project history with Git-like version control. Learn how to create commits, branch your work, merge changes, and collaborate effectively.
Introduction
Structor's version control system lets you experiment freely without fear of breaking your project. In this tutorial, you'll learn how to use branches, commits, and history to manage your project effectively.
Step 1: Understanding Version Control
Version control in Structor works like Git but simplified for visual development:
- Branches: Parallel versions of your project (e.g., main, feature/new-design)
- Commits: Save points in history that you can return to
- Head: The current state of your project
Step 2: Creating Your First Commit
- Make some changes to your project (add elements, modify styles, etc.)
- Look at the top bar - you'll see a gray dot next to the project name indicating unsaved changes
- Click the Branch Selector in the top bar (usually shows "main")
- In the dropdown, find the Create Commit section
- Type a commit message, e.g.: "Initial landing page design"
- Click Commit Changes
- The gray dot should disappear, and your changes are now saved in history
Step 3: Creating a Branch
Branches let you work on new features without affecting the main project:
- Click the Branch Selector in the top bar
- Click New Branch
- Enter a branch name (e.g.,
feature/dark-modeorexperiment/new-layout) - Press Enter or click outside
- You're now working on the new branch!
- The branch name in the top bar will update
Step 4: Switching Between Branches
- Click the Branch Selector
- You'll see a list of all your branches
- Click on any branch to switch to it
- Important: Any unsaved changes (gray dot) will be discarded when switching branches, so commit first!
Step 5: Viewing Commit History
- Click the Branch Selector
- Next to the branch name, click the History icon (clock symbol)
- You'll see a timeline of all commits on the current branch
- Each commit shows:
- Commit message
- Date and time
- Author information
- Click on a commit to see more details
Step 6: Restoring to a Previous Version
If you want to go back to a previous state:
- Open the commit history (Step 5)
- Find the commit you want to restore to
- Click Restore to this version
- Warning: This will overwrite your current working state!
- Confirm the action
- Your project will be restored to that commit's state
Step 7: Working with Multiple Branches
Example Workflow:
- Start on
mainbranch with a working project - Create branch
feature/new-header - Make changes and commit: "Add new header design"
- Switch back to
main- your changes aren't there (they're on the feature branch) - Switch back to
feature/new-header- your changes are there - Continue working on the feature branch
Step 8: Best Practices
- Commit often: Create commits for logical units of work
- Use descriptive messages: "Add contact form" is better than "Update"
- Branch for experiments: Try new designs on branches
- Keep main stable: Only merge tested features to main
- Commit before switching: Always commit before changing branches
- Create and manage commits
- Create and switch branches
- View commit history
- Restore previous versions
- Work with multiple branches
- Practice branching for feature development
- Learn about deploying your project
- Check the version control documentation for advanced features
Congratulations!
You've learned how to: