|
| 1 | +--- |
| 2 | +id: sync-with-gitlab |
| 3 | +title: Sync with GitLab |
| 4 | +sidebar_label: Sync with GitLab |
| 5 | +slug: /sync-with-gitlab |
| 6 | +toc_max_heading_level: 2 |
| 7 | +--- |
| 8 | + |
| 9 | +# Sync with GitLab |
| 10 | + |
| 11 | +Amplication provides seamless integration with GitLab repositories, enabling automated code synchronization for your services. This integration allows you to maintain full control of your generated code with GitLab's version control features. |
| 12 | + |
| 13 | +## Add GitLab Organization |
| 14 | + |
| 15 | +Follow these steps to add your GitLab organization: |
| 16 | + |
| 17 | +1. Navigate to the [Service Catalog](/service-catalog) |
| 18 | +2. Select the **Git Settings** tab |
| 19 | +3. Click **Change Repository** if a repository is already connected |
| 20 | +4. Open the **Select Git Organization** dropdown |
| 21 | +5. Choose **Add Organization** |
| 22 | +6. Select GitLab from the provider list |
| 23 | + |
| 24 | + |
| 25 | + |
| 26 | +## Authorize GitLab Access |
| 27 | + |
| 28 | +When you select GitLab, you'll be redirected to GitLab's authorization page. Here you'll grant Amplication the necessary permissions to interact with your repositories. |
| 29 | + |
| 30 | + |
| 31 | + |
| 32 | +## Configure Repository |
| 33 | + |
| 34 | +After authorization, you'll have two options for repository setup: |
| 35 | + |
| 36 | +### Option 1: Select Existing Repository |
| 37 | + |
| 38 | +Choose from your available GitLab repositories in the repository selection modal. |
| 39 | + |
| 40 | + |
| 41 | + |
| 42 | +### Option 2: Create New Repository |
| 43 | + |
| 44 | +Click the "Create repository" button to set up a new GitLab repository. |
| 45 | + |
| 46 | + |
| 47 | + |
| 48 | +## Service-Specific Repository Settings |
| 49 | + |
| 50 | +Amplication provides two levels of Git configuration: |
| 51 | + |
| 52 | +- **Project-level Git Settings**: Located in the Service Catalog's Git Settings tab, this controls the default repository settings for all services in your project |
| 53 | +- **Service-level Git Settings**: Found within each individual service's settings, this allows you to override the project-level configuration for specific services when needed |
| 54 | + |
| 55 | +When you override the project settings for a service, that service will maintain its own independent Git configuration separate from the project defaults. |
| 56 | + |
| 57 | +To configure Git settings for a specific service: |
| 58 | + |
| 59 | +1. Access your service from the Service Catalog |
| 60 | +2. Navigate to the service's Git Settings page |
| 61 | +3. Toggle **Override project settings** |
| 62 | +4. Follow the repository setup steps to configure a service-specific repository |
| 63 | + |
| 64 | +## Create Merge Requests |
| 65 | + |
| 66 | +To push your changes to GitLab: |
| 67 | + |
| 68 | +1. Make your desired changes in Amplication |
| 69 | +2. Access the pending changes sidebar in your service catalog |
| 70 | +3. Click "Generate the code" to initiate the build process |
| 71 | + |
| 72 | + |
| 73 | + |
| 74 | +## View Commits and Builds |
| 75 | + |
| 76 | +To track your changes: |
| 77 | + |
| 78 | +1. Go to your Service Catalog |
| 79 | +2. Click on the Commits tab |
| 80 | +3. View all your builds and their corresponding merge requests |
| 81 | + |
| 82 | +:::important |
| 83 | +Do not delete the `amplication` branch. This branch is essential for Amplication's synchronization process. |
| 84 | +::: |
| 85 | + |
| 86 | + |
| 87 | + |
| 88 | +## Next Steps |
| 89 | + |
| 90 | +Learn more about Amplication's Git integration features: |
| 91 | + |
| 92 | +- Branch management strategies |
| 93 | +- Merge request workflows |
| 94 | +- Conflict resolution |
| 95 | + |
| 96 | +Visit our [Smart Git Sync](/smart-git-sync) documentation for detailed information. |
0 commit comments