Only in Mage Pro.Try our fully managed solution to access this advanced feature.
1. Connect repository
From the Home page, select Deployments in the left-hand navigation menu to access the Deployments interface. Click the Setup connection button to begin syncing with your code repository.
- In Mage Pro the default directory will be
/home/src/default_repo
. - If you changed the
USER_CODE_PATH
environment variable in the Mage Cloud Management Portal, your directory will need to reflect that change.
- If you have a nested GitHub project, you may want to set the target directory to
/home/src

1.1 Syncing to Github
Step 1: Click the “Connect” button to the right of the GitHub connection- This will take you to the GitHub sign-in authentication
- After authenticating you will return to the Mage-Pro deployment app
- You should now see that you are connected to Github
- If there are no organizations listed, add an organization to the text field below and click the Set organization button
- You should see all your Github repos here if you authenticated correctly

If you need to connect deployments to a private Github repo, provide an organization then click the Install Mage Pro app on Github button.
1.2 Syncing to BitBucket
Mage Pro now supports integration with BitBucket repositories for version control, collaboration, and deployments.Connect workspace
Go to the Deployments application and use Mage Pro’s “Connect repository” feature to link your BitBucket account through secure authentication. From the Home page, select Deployments in the left-hand navigation menu to access the Deployments interface. Click the Setup connection button to begin syncing with your BitBucket repository. Connect to BitBucket using Oauth tokens: Once you are in the connect repository UI take the following steps: Step 1: Set your directory as the user code path you intend to use for your project.- In Mage Pro the default directory will be
/home/src/default_repo
. - If you changed the
USER_CODE_PATH
environment variable in the Mage Cloud Management Portal, your directory will need to reflect that change.

- This will take you to the BitBucket sign-in authentication
- After authenticating you will return to the Mage-Pro deployment app
- You should now see that you are connected to BitBucket

- If there are no organizations listed, add an organization to the text field below and click the “Set organization” button
- You should see a list of all the repositories that were created in the workspace.
- The production branch is the primary branch that your production code will mirror.

Conclusion
Integrating Mage Pro with BitBucket and GitHub through OAuth credentials enables seamless version control for data pipelines. Teams can use both the visual Mage Pro interface and standard Git commands across both platforms, ensuring robust collaboration and deployment workflows for production data systems.3. Version control application and Git terminal commands
Once connected to a GitHub account, you can efficiently manage your codebase by pushing and pulling files directly from the terminal. Utilize standard Git commands to perform various version control operations, such as:git checkout -b <branch-name>
(Creates and switches to a new branch named <branch-name>
, enabling isolated development for features or fixes.)
git status
Displays the current state of the working directory and staging area, highlighting modified, staged, and untracked files.
git add .
(Stages all changes in the current directory and its subdirectories, preparing them for the next commit.)
git commit -m "<commit-message>"
(Records the staged changes in the repository with a descriptive message <commit-message>
, creating a new commit in the current branch.)
git push origin <branch-name>
(Uploads the commits from the local <branch-name>
to the corresponding remote branch on GitHub, making the changes available to collaborators.)

3.1 Troubleshooting version control application git commands:
When trying to connect to github, you may run into a few roadblocks along the way- Make sure you are in the correct folder
home/src/<Your user code path>
- you may need to globally configure your email and username to your gituhub.
git config --global user.email "[your_email@example.com](mailto:your_email@example.com)"
git config --global [user.name](http://user.name/) "Your Username"
4. Merge pull request
Once you push code to your git branch, head to Github and merge the pull request. Once the pull request is merged your deployment will be available in the deployments application interface.5. Deploying code
Mage simplifies the deployment of code to production pipelines. Follow these steps to deploy your pipeline’s CI/CD Git branches. Currently, Mage Pro offers developers a flexible way to deploy code to different Git branches through its terminal.- Once you have merged the pull request in Github navigate back to the deployments tab and click deployments highlighted in green in the top
- Click the Deploy button to deploy the current version you just merged
- To revert to a previous version, simply click the “Rollback” button to deploy the desired version.

Sync to GitLab
This part of the guide walks you through the process of connecting your Mage Pro environment to GitLab. Once connected, your team will be able to push and pull code from GitLab repositories, collaborate on pipeline development, and maintain version history of your data workflows.Update environment variables
First, You will need to set the following environment variables in your Mage environment:- GITLAB_CLIENT_ID: the application ID you retrieved in the previous step
- GITLAB_CLIENT_SECRET: the secret you retrieved in the previous step
- GITLAB_HOST (optional): hostname for your GitLab instance.

Authenticate with GitLab
Next developers will have to authenticate the Mage Pro application with GitLab. To do this they should:- Navigate to the import existing feature by clicking on the dropdown menu located in the top right of the application.
- Click the “Import existing” button
- Scroll down and then click the Authenticate with GitLab button. This will take you to the GitLab authentication page where you will sign into your account.

- Sign into your GitLab account and then make sure the Mage Pro application is installed on the account.

- Ensure the Mage Pro application is installed onto your Gitlab account
Currently the deployments application is only available for GitHub, GitLab, and Bitbucket users.