Version Control & Git Integration in Mage Pro

Version Control & Git Integration in Mage Pro

Overview

Mage Pro makes version control and Git integration effortless for data engineers and machine learning practitioners. By connecting directly to GitHub, you can manage your codebase, collaborate with your team, and deploy pipelines seamlessly across multiple environments. With built-in deployment stages and rollback capabilities, Mage Pro ensures your workflows are efficient, secure, and reliable.

Try it out today! 🚀

How it works

Mage Pro integrates with GitHub using OAuth tokens, enabling you to sync your repository directly within the platform. You can configure deployment stages for different environments (Development, Testing, Staging, Canary, Production) and use standard Git commands in the terminal to manage branches, commits, and pushes. Once your code is ready, you can deploy it to production or roll back to previous versions if necessary.

Why it matters

Version control and Git integration in Mage Pro provide significant benefits:

  • Collaboration: Work seamlessly with your team using Git workflows.

  • Efficiency: Streamline deployments with pre-configured stages.

  • Reliability: Maintain a complete history of changes and roll back when needed.

  • Security: Authenticate securely with OAuth tokens for GitHub access.

Step-by-Step Guide

1. Syncing to a GitHub Repository

Connect Your Repository
  1. Navigate to Deployments in the left-hand menu.

  2. Click Setup connection to start syncing with your GitHub repository.

  3. Follow these steps:

    • Set the directory as your user code path (e.g., /home/src/default_repo).

    • Click Connect next to the GitHub connection.

    • Sign in with your GitHub credentials.

    • Select your GitHub organization from the dropdown list.

    • Choose the repository you want to sync.

    • Select the branch (e.g., main or master).

    • Click Next step to deployment stage.

2. Configuring Deployment Stages

Add Deployment Stages
  1. Click Add stage in the deployment interface.

  2. Configure each stage:

    • Select the environment type (Development, Testing, Staging, Canary, or Production).

    • Specify the branch name (e.g., main or master).

    • Add the target directory (e.g., /home/src/default_repo).

    • Provide an optional description for clarity.

  3. Repeat these steps for additional stages as needed.

  4. Click Deployment triggers once all stages are configured.

3. Using Git Commands in Mage Pro Terminal

Common Commands
  • Create and switch branches:

    git checkout -b <branch-name


  • Check status:

    git status


  • Stage changes:

    git add


  • Commit changes:

    git commit -m "<commit-message>"


  • Push changes:

    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.)

Troubleshooting
  • Ensure you are working in the correct folder: /home/src/<Your user code path>.

  • Configure global settings for username and email if needed:

    git config --global user.email "[your_email@example.com]"
    git config --global user.name "Your Username"


4. Merging Pull Requests

  1. Push your code changes to the appropriate branch on GitHub.

  2. Open a pull request on GitHub and merge it into the main branch.

5. Deploying Code

Deploy Code
  1. Navigate back to Deployments in Mage Pro.

  2. Click the Deploy button to deploy the current version of your pipeline.

Rollback Code

If necessary, click the Rollback button to revert to a previous version of your pipeline.

Mage Pro’s version control and Git integration ensure that managing data pipelines is simple, secure, and collaborative—helping you focus on building impactful solutions without worrying about deployment complexities!

Your AI data engineer

Power data, streamline workflows, and scale effortlessly.

Power data, streamline workflows, and scale effortlessly.