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
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
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)
Add a new connection
Authorize with Bitbucket
Select a workspace
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.
Open the project's Bitbucket settings
Connect the project
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
- 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)
main branch. Changes pushed to the currently active branch sync back into Lovable.
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.
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.
Branch names must follow Git naming rules (no spaces, .., leading or trailing dots or dashes, and special characters such as ~ ^ : ? * [ ] \).
Source: <active branch> in the dialog). Lovable automatically switches to the new branch and starts editing and syncing it.
Clone the repository locally
After connecting a project, Lovable provides clone URLs for:- HTTPS
- SSH
Commit attribution
Commits made by Lovable are authored by Lovable’s bot identity. In the commit log the author readsgpt-engineer-app[bot], an earlier name for that identity, and Bitbucket does not link it to an account. Lovable pushes the commits through the authorization of the Atlassian account that connected the workspace. That account is not necessarily the member who made the change, and Lovable does not add a Co-authored-by line on Bitbucket repositories.
To record who triggered each commit, enable Include member email addresses in commits in workspace settings. See Commit attribution (Business and Enterprise plans).
Disconnect a project from Bitbucket
When you disconnect a project, Lovable removes the link between the project and its Bitbucket repository. When you disconnect:- Sync stops. The two-way connection between Lovable and Bitbucket ends.
- Your repository stays on Bitbucket. It remains intact with all history and files.
- Your project and its code stay in Lovable. Future changes are stored only inside Lovable.
- Lovable creates a new repository with the current version of your project.
- The original repository stays unchanged on Bitbucket and is no longer linked to Lovable.
Unlink projects from a workspace Bitbucket connection
Workspace admins and owners can remove specific projects from a connection without deleting the connection entirely. The connection remains available for other projects.Open Bitbucket settings
Open the connection
Select projects
Confirm
- Click Unlink N projects (where
Nis the number of projects you selected) - Click Unlink to confirm
Delete a workspace Bitbucket connection
Workspace admins and owners can delete Bitbucket connections. When you delete a workspace Bitbucket connection, Lovable:- Removes the connection for all projects
- Stops syncing for linked projects
- Removes the Lovable webhook from the Bitbucket workspace
- Keeps the repositories on Bitbucket
- Deletes the stored credentials
Open Bitbucket settings
Open the connection you want to remove
Review linked projects
Delete
Limitations
The Bitbucket Git sync integration currently does not support:- Bitbucket Data Center or Bitbucket Server. Lovable supports Bitbucket Cloud (bitbucket.org) only.
- Importing existing Bitbucket repositories into Lovable. You can only export from Lovable to Bitbucket.
- Reconnecting to the same repository after disconnecting. Lovable creates a new repository on reconnect.
- Connecting the same Bitbucket workspace more than once.
- Following a repository moved to a Bitbucket workspace that is not connected to your Lovable workspace.
FAQ
Do I need to know Bitbucket to use this feature?
Do I need to know Bitbucket to use this feature?
Does Lovable support Bitbucket Data Center or Bitbucket Server?
Does Lovable support Bitbucket Data Center or Bitbucket Server?
Is the repository Lovable creates public or private?
Is the repository Lovable creates public or private?
What happens if I rename my Bitbucket repository?
What happens if I rename my Bitbucket repository?
What happens if I rename my Bitbucket workspace?
What happens if I rename my Bitbucket workspace?
What happens if I move my repository to another Bitbucket workspace?
What happens if I move my repository to another Bitbucket workspace?
- Add a workspace connection for the destination Bitbucket workspace.
- Open the project’s Bitbucket settings and connect the project to that connection.
What happens if I delete my Bitbucket repository?
What happens if I delete my Bitbucket repository?
How can I switch to a different Bitbucket workspace or Atlassian account?
How can I switch to a different Bitbucket workspace or Atlassian account?
- Disconnect the project from Bitbucket in the project’s Bitbucket settings.
- Add a connection for the other Bitbucket workspace, if your Lovable workspace doesn’t have one yet.
- Connect the project to that connection.
Can I disconnect from Bitbucket?
Can I disconnect from Bitbucket?
Can I import an existing Bitbucket repository into Lovable?
Can I import an existing Bitbucket repository into Lovable?
Can I connect multiple Bitbucket workspaces?
Can I connect multiple Bitbucket workspaces?
Troubleshooting
When something goes wrong, Lovable shows a Connection lost message with a Reconnect button in the affected project’s Bitbucket settings.The connected git provider session has expired or been revoked. Reconnect to continue syncing.
The connected git provider session has expired or been revoked. Reconnect to continue syncing.
- Open the affected project’s Bitbucket settings.
- Click Reconnect. A popup opens to Atlassian’s sign-in page.
- Sign in with an account that has admin access to the same Bitbucket workspace and grant Lovable access.
The Lovable webhook on this Bitbucket workspace was removed, so changes made in Bitbucket no longer reach this project. Reconnect to restore it.
The Lovable webhook on this Bitbucket workspace was removed, so changes made in Bitbucket no longer reach this project. Reconnect to restore it.
New Bitbucket workspaces take a few minutes to activate; retry shortly.
New Bitbucket workspaces take a few minutes to activate; retry shortly.
This repository is no longer accessible. Try reconnecting, or disconnect to connect this project to a different repository.
This repository is no longer accessible. Try reconnecting, or disconnect to connect this project to a different repository.
- Restore the repository on Bitbucket. Move it back to its original workspace. Sync resumes automatically.
- Start a new repository. Open the project’s Bitbucket settings, disconnect the project, then connect it again. Lovable creates a new Bitbucket repository with your current code.
My commits and pushes from Bitbucket aren't showing up in Lovable.
My commits and pushes from Bitbucket aren't showing up in Lovable.
main.If you pushed commits to a different branch in Bitbucket, you have two options:- Merge your changes into the synced branch. For example, open a pull request from your feature branch into
mainand merge it. Lovable then picks up those commits. - Switch the synced branch in Lovable. In your project’s Bitbucket settings, select the branch where your commits live. Lovable starts editing and syncing that branch instead, and your commits will appear.
I see a "lovable-fallback" branch in the branch picker.
I see a "lovable-fallback" branch in the branch picker.
lovable-fallback so that you can continue editing. Your repository is otherwise unchanged.Pick another branch or recreate the original branch. After you switch away, you can leave or delete lovable-fallback in Bitbucket.My push from Lovable ended up on a "lovable-sync" branch instead of the synced branch.
My push from Lovable ended up on a "lovable-sync" branch instead of the synced branch.
lovable-sync instead, and your project’s Bitbucket settings show “Your changes conflict with commits on <your branch> and could not be merged automatically. They were pushed to the branch lovable-sync instead. Merge that branch into <your branch> to apply them.”Open that branch on Bitbucket, review the changes, and merge them into your synced branch through your usual review process.When a later push is rejected too, Lovable adds those changes to the same lovable-sync branch. If you’ve added your own commits to lovable-sync, Lovable leaves them untouched and pushes to a new branch named lovable-sync-<timestamp> instead. Review and merge that branch the same way.Lovable can't edit a large file in my project.
Lovable can't edit a large file in my project.