Skip to content

Configuring Git in Martini Designer

This guide provides a comprehensive overview of configuring and using Git in Martini Designer, including creating repositories, cloning, pulling, committing, and pushing changes.

Best Practice

It is recommended to have one Git repository per Workspace in Martini Desktop or Martini Online for optimal organization and management.

Creating a Git Repository

To create a Git repository in Martini Desktop:

  1. Open Martini Desktop:
  2. Go to File >> Switch Workspace >> Other.

  3. Specify Workspace Path:

  4. Enter the path for your new workspace (e.g., /my-workspace) and click Launch.

  5. Access the Git Perspective:

  6. Once the workspace loads, switch to the Git perspective by clicking the Git icon on the top right.

  7. Verify Repository:

  8. You will see an empty Git repository without any commits in the Git perspective view.

Cloning a Remote Repository

To clone a remote repository into your workspace:

  1. Shut Down Martini Runtime (if it's running).

  2. Open the Git Perspective:

  3. Click the Git icon on the top right.

  4. Add a Remote:

  5. Navigate to Git Repositories >> Remotes.
  6. Right-click and select Create Remote.
  7. Click Configure Fetch and then Create.

  8. Enter Remote URI:

  9. Copy the URI of the remote repository (e.g., from Bitbucket).
  10. Click Change in Martini Desktop and paste the URI. Click Finish and Save.

  11. Fetch and Reset:

  12. Right-click on the repository and select Fetch from Origin.
  13. Go to Branches, Remote Tracking, right-click on the master branch, and select Reset.
  14. Choose Hard Reset and click Finish.

  15. Verify Files:

  16. Go to the Designer perspective, start Martini Runtime, and check if the files are present.

Pulling Commits from a Remote Repository

To fetch and pull commits from a remote repository:

  1. Configure Remote for Fetching:
  2. Right-click on Origin and click Configure Fetch.
  3. Map your local branch to its remote branch by adding the branch name.

  4. Fetch from Remote:

  5. Right-click on the repository and select Fetch from Origin.
  6. Check the number of commits to pull (indicated by a down arrow).

  7. Compare and Pull:

  8. Use the History view to compare the remote commits with local changes.
  9. Right-click on the repository and select Pull to fetch and merge changes.

  10. Verify Changes:

  11. Go to the Designer perspective and check if the updates are reflected.

Committing Changes

To commit files to your Git repository:

  1. Create and Save Files:
  2. Create a package and service, then save them.

  3. Stage and Commit:

  4. Go to the Git perspective and open the Git Staging view.
  5. Stage files by selecting them and clicking the green plus button.
  6. Write a commit message and click Commit.

  7. Modify and Commit:

  8. Make changes to files (e.g., update service logic), save, and stage the changes.
  9. Write a commit message describing the modifications and click Commit.

  10. Compare Versions:

  11. Right-click on the file and select Compare with Index to view differences between versions.

Pushing Commits to a Remote Repository

To push commits from your local repository to a remote repository:

  1. Add Remote Repository:
  2. Copy the SSH URL of your remote repository.
  3. In Martini Desktop, go to the Git Repositories view.
  4. Right-click on Remote and select Create Remote.
  5. Configure the push by pasting the SSH URL and click Finish, then Save.

  6. Push Branch:

  7. Right-click on the branch you want to push and select Push Branch.
  8. Click Preview and then Push.

  9. Verify Push:

  10. Refresh your remote repository page to ensure the files and commits are visible.

  11. Push Additional Commits:

  12. Make changes, stage and commit them.
  13. Use the Commit and Push button for a combined commit and push operation.