Close

Sign up to Gadget

Git comes to Gadget: Better app development with source control

-

About

You can now branch and manage your entire Gadget project using Git-based source control.

Problem

Solution

Result

Git comes to Gadget: Better app development with source control

Emma Hyde
March 12, 2024

TL;DR: You can now sync your Gadget projects to GitHub and GitLab.

Building with Gadget just got more safe, secure, and revertable: source control is finally here.

Every Gadget project now comes with Git-based source control for your whole application, meaning you can reliably develop, test, and deploy without interfering with the main branch. Like other Git repos, this means teams can safely work at the same time without having to learn any new tools. 

Your entire project’s definition can now be captured with source control, meaning all of your code (obviously), but also your database schema, access control, and connections settings. Git-based source control works seamlessly with unlimited environments, allowing you to create isolated development spaces as needed on whatever branch you like, each with its own set of resources and configurations. 

Better yet – Gadget repos are a perfect match for GitHub. You can use the same branching process, code review approach, and GitHub Actions automations for running your project your way. Confidently experiment, fix bugs, or build new features in separate branches and roll back your changes when necessary without disrupting your production environment.

Watch our tutorial to see how easy it is to set up CI/CD using GitHub Actions and Gadget!
Watch now

Pick your own source control provider

Although developers could always use source control to manage the frontend and backend code for their Gadget projects, up until now the source code didn’t capture changes to the rest of an app, including models, access control, and connections settings. 

Now, Gadget emits metadata files that capture all of your app’s definition in easy-to-read code, ensuring they can be managed while using source control. This means that changes to any part of your app will show up in <inline-code>git diff<inline-code>. These metadata files are also synced back to Gadget, so if you revert a commit, or change branches, or do anything, your app’s models will update to reflect the metadata stored in your repo. You don’t need any tool other than <inline-code>ggt<inline-code> to work with these files, which means your favorite local tools like GitHub Desktop, VSCode GitLens, or even GitHub Copilot can version and modify these files. 

To get started, you’ll need to use <inline-code>ggt<inline-code>, Gadget’s CLI tool, to pull your code into your local machine. You can read details on how in our docs.

Uninterrupted multiplayer

We’re not here to reinvent the wheel. The introduction of source control means Gadget now fits into your existing development workflows, and you can easily work with your team the way you normally would. Use Git workflows to branch, commit, and push changes, and GitHub pull requests to review, discuss, and merge changes into the main branch. 

Gadget environments are specifically built to work with Git-based source control. Each developer can have their own development environment, and everything that can be set, changed, or built in the Gadget editor is now expressed as a code file. Your team can safely work on a bug or build multiple new features in parallel, knowing that your entire project will be contained and managed in Git.

While Gadget’s CLI tool, GGT, is running, changes captured between branches are instantly applied to your remote Gadget environment. Switching branches instantly applies any changes, so there is no added friction to your development process.

Source control is now available on all new Gadget projects, so you can start branching right away. To use source control on an existing project, you will need to upgrade to Gadget framework v1.0. If you want to learn more about working with source control, you can read through our docs for details.

If you have any questions or need help getting started, we’re always here to help in our developer Discord.

Interested in learning more about Gadget?

Join leading agencies making the switch to Gadget and experience the difference a fullstack platform can make.
Keep reading to learn about how it's built

Under the hood

We're on Discord, drop in and say hi!
Join Discord
Bouncing Arrow