-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #301 from amplication/docs/smart-git-sync
Smart Git Sync
- Loading branch information
Showing
6 changed files
with
120 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+40.3 KB
docs/getting-started/assets/sync-with-git-provider/amplication-commit-message.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+389 KB
docs/getting-started/assets/sync-with-git-provider/build-log-message.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+209 KB
docs/getting-started/assets/sync-with-git-provider/github-pull-request.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
--- | ||
id: smart-git-sync | ||
title: Smart Git Sync Explained | ||
sidebar_label: Smart Git Sync Explained | ||
slug: /smart-git-sync | ||
--- | ||
|
||
# Smart Git Sync Explained | ||
|
||
Amplication provides a powerful feature known as _Smart Git Sync_ for syncing the code produced from your project with a git repository. | ||
|
||
Smart Git Sync automatically synchronizes any changes made on your project to your preferred git repository. | ||
This is achieved creating an `amplication` branch that contains all new commits generated by changes and additions on your Amplication project. | ||
|
||
Amplication offers _Smart Git Sync_ for everyone including Free, Pro, and Enterprise plan users. | ||
|
||
On this page, you'll learn how Smart Git Sync works. | ||
You will understand how Amplication manages the `amplication` branch on your repo, creates commits, and initiates pull requests. | ||
|
||
![](https://amplication.com/_next/static/media/sync_with_github.ee2ac5a5.svg) | ||
|
||
## How Smart Git Sync Works | ||
|
||
The primary advantage of using Smart Git Sync is its ability to simplify the process of resolving merge conflicts on each build. This feature enhances the user experience and streamlines work with Amplication. | ||
|
||
When you perform a new build on your Amplication project, Smart Git Sync automatically triggers the creation of a commit on the `amplication` branch. | ||
|
||
:::note | ||
Amplication supports both [GitHub](/sync-with-github) and [Bitbucket](/sync-with-bitbucket) as git providers. | ||
::: | ||
|
||
This commit encompasses all the files that were added, removed, or changed since the last build. | ||
|
||
![](https://amplication.com/_next/static/media/sync_with_github.1d7a27e3.svg) | ||
|
||
### Step-by-step breakdown | ||
|
||
1. You make changes in your Amplication project. This could range from adding a new resource to modifying an existing one. | ||
2. When you're ready, you perform a new build on the project. | ||
3. Smart Git Sync springs into action. It identifies all the files that have been altered since the last build. | ||
4. It then creates a commit on the `amplication` branch, including all these changes. | ||
|
||
For example, let's say you've just added a new _Task_ entity to your project. Once you build the project, Smart Git Sync will create a commit on the `amplication` branch that includes all the files related to the _Task_ entity. | ||
|
||
This method ensures that every single change you make in your Amplication project is automatically tracked and committed to the `amplication` branch in your Git repository. You can then easily review and merge these changes through pull requests. | ||
|
||
:::tip | ||
After completing an Amplication build, review the PR, resolve any conflicts, merge it, and | ||
**delete the `amplication` branch**. | ||
::: | ||
|
||
## The `amplication` branch | ||
|
||
Amplication integrates with your repository through the `amplication` branch. | ||
This branch will contain all commits made by Amplication. | ||
After clicking on **Commit Changes & Build** in the right sidebar on your project's dashboard, Amplication will trigger a commit to the amplication branch containing all your changes. | ||
|
||
When a user creates a repository, an 'amplication' branch is made from the repository's `default` branch. | ||
|
||
For example, Amplication will base the `amplication` branch from `main` if your default branch is `main`. | ||
|
||
You can merge Amplication-made changes by merging pull requests created by Amplication from the `amplication` branch to your repository's default branch. | ||
|
||
:::note | ||
Refrain from modifying the `amplication` branch. Creating new commits or merging changes from other branches can introduce bugs and inconsistencies. In case of conflict, delete the `amplication` branch and resolve the merge conflict in the next PR. | ||
::: | ||
|
||
![](./assets/sync-with-git-provider/github-pull-request.png) | ||
|
||
## Commit Messages and Pull Requests | ||
|
||
Every time a build process is completed in Amplication, Smart Git Sync produces a build message that provides valuable insight into the actions taken during the build. These build messages are automatically included in the commit messages in your Git repository. | ||
|
||
Amplication handles commit messages and pull requests in a manner that promotes clarity and efficient tracking of changes. | ||
|
||
If there isn't an open pull request from the `amplication` branch when a commit is made, Amplication will automatically create one. The title of this pull request and the commit message both come from the input you provide in the commit message box in Amplication's pending changes section. | ||
|
||
:::note | ||
Amplication will generate a default message for your commit if you don't input a message into the pending changes input box. | ||
::: | ||
|
||
Additionally, the first comment on the pull request includes a link back to your build in Amplication. | ||
Visiting this link will take you back to Amplication to see the build log for this specific commit, offering you a comprehensive overview of the changes that were made during the build. | ||
|
||
![](./assets/sync-with-git-provider/amplication-commit-message.png) | ||
|
||
## Conclusion | ||
|
||
Smart Git Sync is a powerful feature that simplifies the integration between Amplication and your Git repository. It automatically tracks and commits changes to a dedicated `amplication` branch. This significantly reduces manual effort and enhances productivity. Whether you're adding a new resource or making a change to an existing one, Smart Git Sync ensures that all changes are systematically tracked, committed, and easy to review. | ||
|
||
## Next Steps | ||
|
||
Learn how to sync your service with your preferred git provider: | ||
|
||
- [Sync With GitHub](/sync-with-github) (Free, Pro, Enterprise) | ||
- [Sync With Bitbucket](/sync-with-bitbucket) (Enterprise) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters