Push it (Mendix to Git) real good

Kasja Maksymiak
5 min readAug 28, 2023

--

I once had a Mendix app that was still running in SVN (stands for Subversion) and I wanted to give it a little upgrade to Git.

For a little version control 101, please read: https://docs.mendix.com/refguide/version-control/

And what the differences are between SVN and Git, see: https://docs.mendix.com/refguide9/svn-git-differences/

Personally, I think the biggest advantage of Git over SVN is that “your locally-committed changes may cause conflicts with changes retrieved from your colleagues. When doing an update, you have to resolve these, and then commit the resolved changes. With Git, you have to commit locally before retrieving these changes. Though this can seem cumbersome, it has the benefit that if you made a mistake when resolving conflicts, you can still view the changes you and your colleagues made and resolve them properly.” (Source: https://docs.mendix.com/refguide9/version-control-faq/#git-advantages)

Okay, but how does that work? And where to start?

Before you start, please read: https://docs.mendix.com/developerportal/general/migrate-to-git/

Enough theory, let’s get this party started!

Step 1 — Mendix Studio Pro 9.12 and higher

If you have an app that is below version 9.12 you have to upgrade it to at least Mendix Studio Pro version 9.12. For demo purposes, I’ve upgraded my oldie to version 9.24.2. So I thought…let me upgrade you!

Step 2 — App role SCRUM Master in Mendix Sprintr

One, two step, if you open your app in https://sprintr.home.mendix.com/ and go to ‘Team’, you will find an overview of all your team members and their app roles. Team members with a SCRUM Master role are allowed to migrate the app to Git.

Step 3 — Don’t be afraid to push that button

If you click ‘Migrate to Git’ nothing scary is going to happen, I promise! First, Mendix will help you with checking if your app meets the migration conditions.

If you click ‘Check Conditions’ you’ll get the final question if you’re really sure about this. After clicking ‘Start migration’ there is no way back!

And then you wait…

You can click ‘Close’ and wait until the migration is done. Which will appear automatically. If you go to ‘Team Server’ you will find your new Git directory.

From here you can click ‘Edit in Studio Pro’ to open your app and see the difference with a Git repository in your Mendix Studio Pro.

Step 4 — check, check, double check

Mendix will automatically open your app in a new app directory (‘Main_2’). The original app directory is still in SVN, so please don’t try to overwrite this. You can later delete the original app directory so you won’t use the wrong app directory by accident.

And there it is! Your app with a Git repository! Now you’re ready to make some local changes and push it real good!

If you commit your changes, you can choose to push the changes to the server, or to commit them to your local Git repository, see “Also push changes to the remote server” boolean.

Step 5 — Exploring GitHub

To view your newly created Git repository, you can open it in Git Desktop, or in your browser. There click “Add” and “Add existing repository...”.

Choose the main folder of your App and click “Add repository”.

After creating you want to fetch of course fetch your newest local Git changes by clicking ‘Fetch original’

Whoops! That doesn’t work! Authentication failed! No worries! This is not about your Mendix account credentials. You have to create a Personal API key first and use as your password. Your username is simply your e-mail address that you use for your Mendix account…so Mendix, say my name!

See: https://docs.mendix.com/developerportal/community-tools/mendix-profile/#profile-api-keys

Step 6 — Generate Personal API Key

First you have to go to https://home.mendix.com/ and click on your avatar to open “User Settings”.

Go to your “Developer Settings” and click “New Token”.

There you have to select the adequate access options.

Step 7 — Fetch it locally

Once you’re authenticated you can start pushing and fetching!

Now the real important question…can you list the guilty pleasure millennial songs hidden in this blog?

Bye bye bye!

--

--