Sync your Lovable project with Bitbucket - Lovable Documentation
Documentation Index Fetch the complete documentation index at: /llms.txt Use this file to discover all available pages before exploring further. Skip to main content Assistant Responses are generated using AI and may contain mistakes. When you build with Lovable, your project code is stored and managed inside the Lovable platform. Bitbucket is Atlassian’s platform for storing, managing, and sharing code, with version control, pull requests and code reviews, Bitbucket Pipelines for automated builds and deployments, and Jira integration.
If you want your own copy, plan to collaborate with developers, or move your project elsewhere, you can export and sync your project to Bitbucket Cloud: back up your code, review changes in pull requests, work locally in your IDE, test features on branches, and deploy outside Lovable. For the full picture of what Git sync is, how the two-way sync model works across providers, and how to choose between GitHub, GitLab, and Bitbucket, see the Git sync overview .
Lovable syncs with Bitbucket Cloud (bitbucket.org). Lovable does not support self-hosted Bitbucket Data Center or Bitbucket Server instances. You don’t need Bitbucket to use Lovable. Many users build and launch entirely within Lovable. If you only need a copy of your code, you can download your code directly from Lovable: use the Download codebase section in Project settings → Git , or open the Code editor and click Download codebase at the bottom of the file tree sidebar (paid plans).
How Bitbucket Git sync works Like all Git sync , the Bitbucket integration has two layers: A workspace connection A project repository link Workspace connection A workspace connection authorizes Lovable to access one Bitbucket Cloud workspace. You sign in with your Atlassian account and grant Lovable access, then choose the Bitbucket workspace to connect. Lovable registers a webhook on that workspace so that changes on Bitbucket reach your projects.
A webhook is a notification Bitbucket sends to Lovable whenever something happens in the workspace, such as a push. Every project in the Lovable workspace can use the same workspace connection. A Lovable workspace can contain: Multiple Bitbucket connections, one per Bitbucket workspace Bitbucket connections alongside GitHub and GitLab connections Each Bitbucket workspace can be connected once per Lovable workspace. You need admin access to the Bitbucket workspace you connect.
Lovable registers a workspace-level webhook during setup, and Bitbucket only allows workspace admins to do that. Project repository link A project repository link connects one Lovable project to one Bitbucket repository. When connected: Changes made in Lovable sync to Bitbucket Changes pushed to the active Bitbucket branch sync back into Lovable Lovable only edits and syncs one branch at a time Role-based access for Bitbucket integration Role Allowed action Workspace owner or admin only Add a workspace connection Reconnect a workspace connection (re-authorize with Atlassian) Unlink projects from a workspace connection Delete a workspace connection Enable or disable Include member email addresses in commits (Business and Enterprise plans) Workspace owner or admin Project owner or admin Connect a project to a repository Disconnect a project from a repository Workspace editor or higher Project editor or higher View sync status Switch branches Create branches View the connection in Workspace settings → Git → Bitbucket Create a workspace Bitbucket connection Workspace admins and owners can create workspace connections from: Workspace settings → Git → Bitbucket → Add connection Project settings → Git → Bitbucket → Add connection (if a project has not been connected yet) You need an Atlassian account with admin access to at least one Bitbucket Cloud workspace.
You can create a Bitbucket account for free at bitbucket.org . 1 Add a new connection Click Add connection . The Connect Bitbucket screen opens. 2 Authorize with Bitbucket Click Authorize with Bitbucket . A popup opens to Atlassian’s sign-in page. Sign in and grant Lovable access. Atlassian stores the authorization on your Atlassian account, not on the Bitbucket workspace. You can review or revoke it later under Connected apps in your Atlassian account settings.
3 Select a workspace Under Select workspace , Lovable lists the Bitbucket workspaces available on your account. Click Connect next to the workspace you want to use. If only one workspace is available, Lovable connects it directly and skips this step. Workspaces that are already connected to your Lovable workspace do not appear in the list. A Bitbucket workspace you created within the last few minutes cannot receive pushes yet, because Bitbucket activates new workspaces with a short delay.
If you connect a project right after creating the workspace, Lovable shows how long to wait. Try again after that time. Link a project to a Bitbucket repository With an active workspace Bitbucket connection in place, workspace or project admins and owners can connect a Lovable project to a Bitbucket repository. When you connect a project, Lovable creates a new Bitbucket repository. The repository is private , so nobody can see your code unless you change its access level on Bitbucket.
The repository is named after your project. If the workspace already has an empty repository with that name, Lovable uses it. If the existing repository has commits, Lovable adds a short suffix to the new repository’s name instead. Each Lovable project can connect to one repository on one provider. If the project already syncs with GitHub or GitLab, the Bitbucket card does not appear in Project settings → Git until you disconnect the project from that provider.
1 Open the project's Bitbucket settings Open Project settings → Git → Bitbucket . 2 Connect the project Under Connect project , click Connect next to the Bitbucket workspace where the new repository should be created. Lovable creates a new Bitbucket repository and starts two-way sync automatically. Don’t delete your Bitbucket repository or move it to a Bitbucket workspace that is not connected to your Lovable workspace.
Doing so breaks the sync, and Lovable won’t be able to update your project. You can rename the repository or the Bitbucket workspace: Lovable tracks both automatically. Manage a project’s repository sync After connecting a project to a Bitbucket repository, you see the following in the project’s Bitbucket settings: Repository status as Connected Sync status card showing whether Lovable and Bitbucket are on the same commit Branch picker with active branch name (Bitbucket branch synced with Lovable) Clone URLs (HTTPS, SSH) Option to View on Bitbucket (available from the dropdown) Option to Disconnect (available from the dropdown) Lovable only edits and syncs one branch at a time.
By default, this is the main branch. Changes pushed to the currently active branch sync back into Lovable. If the sync status card says Lovable and Bitbucket have diverged , Lovable and Bitbucket each have commits that the other does not. Lovable pushes its changes to the lovable-sync branch instead of the synced branch, as described under Troubleshooting , and the next sync from Bitbucket replaces Lovable’s version of the branch with the Bitbucket version.
Re-check compares the branches again and doesn’t sync anything. Switch branches Use the branch picker in the project’s Bitbucket settings to change which branch Lovable edits and syncs. Click the branch picker. Search or select a branch. Click the branch to switch. Lovable immediately starts editing and syncing the branch you switched to. You can switch back to the default branch at any time. Create a new branch You can create a branch from the same picker without leaving Lovable.
Click the branch picker. Click Create branch at the bottom of the list. Enter a branch name. Lovable validates it against empty names, invalid characters, and duplicates.
The rest of this page is on the live site.