Skip to content

Commit

Permalink
Merge pull request #301 from amplication/docs/smart-git-sync
Browse files Browse the repository at this point in the history
Smart Git Sync
  • Loading branch information
mulygottlieb authored Sep 6, 2023
2 parents 9a2819c + c4da8b1 commit 09a8dac
Show file tree
Hide file tree
Showing 6 changed files with 120 additions and 23 deletions.
43 changes: 22 additions & 21 deletions docs/faqs/faqs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ See [Amplication’s licensing model](https://docs.amplication.com/about/about/l

The Free edition is the best option for individuals and small teams who build smaller projects.

It includes everything you need to build backend services with Amplication, including database and data models management, roles & permissions, GraphQL & Rest APIs, admin UI, custom code, community plugins, unlimited code generation builds, and unlimited code push to git.
It includes everything you need to build backend services with Amplication, including database and data models management, roles & permissions, [Smart Git Sync](/smart-git-sync/) to easily sync your code to your favorite git provider, GraphQL & Rest APIs, admin UI, custom code, community plugins, unlimited code generation builds, and unlimited code push to git.

The Free edition is limited to 3 services and to 7 entities per service. It includes seats for 2 team members.

### Pro Edition

The Pro edition is for businesses that want to build on a larger scale, for advanced use cases that require more customizability, and when working with larger teams.

It includes everything from the free plan with the following additional benefits: Smart sync with GitHub to easily resolve conflicts with custom code, unlimited services and entities per service, up to 10 team members.
It includes everything from the free plan with the following additional benefits: Unlimited services and entities per service, and up to 10 team members.

### Enterprise Edition

Expand All @@ -80,10 +80,10 @@ it wherever you want; on the public cloud, private cloud, or on-premise.

## How can I get the code?

You can download the source code of your application or connect to your GitHub
account and push a new Pull Request directly to a selected GitHub repository. There
You can connect your project to your preferred git provider like [GitHub](/sync-with-github) or [Bitbucket](/sync-with-bitbucket).
After connecting to a git repo you can push a new Pull Request directly to a selected git repository. There
is also a code-view option, that enables you to view the code in the console before
you download it or move it to GitHub.
you download it or move it to your git provider.

---

Expand Down Expand Up @@ -131,16 +131,14 @@ your code while continuing to get code from Amplication.

## Can I contribute to the development of Amplication?

We'd love to have you contribute! To find out how,read -

[Contributing](https://docs.amplication.com/contributing/)
We'd love to have you contribute! To find out how,read our [Contributing](https://docs.amplication.com/contributing/) guide.

---

## Can I work with GitLab (or other git providers) besides GitHub?

Amplication currently supports integration only with GitHub, but we are planning
to add support for more Git providers. See our [Product Roadmap](https://docs.amplication.com/about/roadmap/).
Amplication currently supports integration only with [GitHub](/sync-with-github) and [Bitbucket](/sync-with-bitbucket),
but we are planning to add support for more Git providers. See our [Product Roadmap](https://docs.amplication.com/about/roadmap/).

---

Expand Down Expand Up @@ -207,10 +205,11 @@ Amplication incorporates the following practices to provide you with a platform
-Microservices support
-Plugin system
-Monorepo with modular connected services
-Custom sync flows and GitHub sync at the project level
-Custom sync flows and [smart git sync](/smart-git-sync) at the project level

With these new features and improvements in our new version, we make it much easier for you (or your team) to build scalable services, have better control over the generated code and collaborate with multiple developers to work on large scale solutions.

To know more on how to use Amplication to your advantage [Read](https://amplication.com/blog/amplication-version-10-is-now-live)
To know more on how to use Amplication to your advantage [read](https://amplication.com/blog/amplication-version-10-is-now-live) our blog post.

---

Expand Down Expand Up @@ -254,7 +253,7 @@ Check out our docs for more on syncing to a git repository and how Amplication h

Microservices (or microservices architecture) is a cloud native architectural approach in which a single application is composed of many loosely coupled and independently deployable smaller components, or services.

Want more Information?[Read this](https://amplication.com/blog/an-introduction-to-microservices)
Want more information? [Read this](https://amplication.com/blog/an-introduction-to-microservices).

---

Expand All @@ -266,13 +265,13 @@ Project development becomes easier with the following functionalities:
-You can connect to a single git repo at the project level saving a lot of your time that would be spent manually connecting the services
-You can make a single commit at the project level

Learn more about the benefits [Here](https://amplication.com/blog/release-0150-support-for-microservices-architecture)
Learn more about the benefits [here](https://amplication.com/blog/release-0150-support-for-microservices-architecture).

---

## How are microservices incorporated in Amplication?

Amplication supports microservices through the Project hierarchy. A Project groups together multiple resources used and created by Amplication, enabling support for multiple use cases. This simplifies the creation of connected Services, and makes it much easier to sync with GitHub across multiple Services.
Amplication supports microservices through the Project hierarchy. A Project groups together multiple resources used and created by Amplication, enabling support for multiple use cases. This simplifies the creation of connected Services, and makes it much easier to [sync with your preferred git provider](/smart-git-sync/) across multiple Services.

---

Expand All @@ -282,16 +281,18 @@ This structure helps you to manage various services (architected as microservice

It provides a much simple and easy-to-maintain project flow with multiple services.

Read more about the Hierarchy [Here](https://docs.amplication.com/projects-resources-services/)
Read more about the hierarchy [here](https://docs.amplication.com/projects-resources-services/).

---

## How do I keep track of my codebase if it involves continuous development?

Amplication comes with version control built-in enabling you to see the changes made in the services and push the code, after verification, to your GitHub repository. In Amplication, your work is auto saved but not committed, thus giving you the opportunity to review.
Amplication comes with version control built-in enabling you to see the changes made in the services and push the code to your preferred git provider.
We call this feature [Smart Git Sync](/smart-git-sync/).
In Amplication, your work is auto saved but not committed, thus giving you the opportunity to review.
All the pending changes are visible under 'Pending Changes', ready for you to review and commit.

Read [this](https://docs.amplication.com/how-to/commit-changes/)
Read [How To Commit Changes](https://docs.amplication.com/how-to/commit-changes/).

---

Expand All @@ -315,10 +316,10 @@ This information is used to better understand the usage of amplication platform

## For any issue related to Amplication development where can I get answers?

You can look into the [docs](https://docs.amplication.com/) under 'Troubleshooting' that have answers for a number of Issues relating to Set-up, Code Generation, Database, Authorization, Github.
or if it's a new issue you can ask in the community or raise an issue yourself in GitHub.
You can look into the [docs](https://docs.amplication.com/) under [_Troubleshooting_](/errors/) that have answers for a number of Issues relating to Set-up, Code Generation, Database, Authorization, and Git Sync.
If it's a new issue you can ask in the community or raise an issue yourself in GitHub.

Read the guidelines to contribute [Here](https://docs.amplication.com/contributing/).
Read the guidelines to contribute [here](https://docs.amplication.com/contributing/).

---

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
96 changes: 96 additions & 0 deletions docs/getting-started/smart-git-sync.md
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)
4 changes: 2 additions & 2 deletions sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const sidebars = {
items: [
"getting-started/sync-with-github",
"getting-started/sync-with-bitbucket",
"getting-started/sync-with-git-differences-between-plans",
"getting-started/smart-git-sync"
]
},
{
Expand Down Expand Up @@ -285,4 +285,4 @@ const sidebars = {
],
};

module.exports = sidebars;
module.exports = sidebars;

0 comments on commit 09a8dac

Please sign in to comment.