# Connect to an existing repository If you already have an application that you want to deploy to Amverum, but it already uses another git repository (GitHub, Bitbucket, or something else), you can link an additional remote to your repository. ```{eval-rst} .. admonition:: Clue :class: hint To get acquainted with the principle of working with git, we recommend `this article `_, which will simplify working with our service. ``` The address of the remote repository is located on the Repository page of the application. ![python_config](../../img/git_main.png) ## Connecting the repository Open a command prompt and navigate to the root folder of your application project. Run the command: ```shell git remote add amverum https://git.amverum.ru// ``` ## Populating the repository In order to build and run the code, you need to have an [amverum.yaml configuration file](../configuration/config-file.md) and/or a [Dockerfile](../configuration/docker.md). We also recommend that you familiarize yourself with the process of [building](../build.md) and [deploying](../run.md) the application. ## Project deployment To initialize the process of building and deploying the application, it is enough to send changes to the Amverum repository. ```shell git push amverum master ``` When prompted for a username and password, provide the username and password for your Amverum account. ```{eval-rst} .. admonition:: Clue :class: hint Running instances of your project will not stop if a build error occurs and will continue to run. ``` ## Example 1. Call the terminal in the IDE where the application is open, or open the project folder in the terminal. 2. Initialize the local git repository with the command (if it is not initialized) ```shell git init ``` 3. Add a remote repository of our project (the URL of your repository will be different. To avoid syntax errors, copy the link in the second step of creating the project) ```shell git remote add amverum https://git.amverum.ru/Your_Nick/Project_Name ``` ```{eval-rst} .. admonition:: Important :class: warning If you set the configuration in the interface, do not forget to do git pull (git pull amverum master) to synchronize repositories. If you do not want to synchronize repositories, then create yaml by `link `_, add it to the root of the repository before the first push. In this case, do not add/set the configuration in the interface. Setting the configuration and adding files in the interface creates a commit, after which you need to synchronize the repositories when working through git. ``` 4. Let's add files and make the first commit. ```shell git add . git commit -m "initial commit" ``` 5. Let's push our code to the project repository ```shell git push amverum master ``` 6. When you want to update the project (you updated the code/configuration/dependencies), run the commands: ```shell git add . git commit -m "Description of changes made" git push amverum master ``` ## Possible errors If the main branch is not called `master`, but, for example, `main`, an error will appear when executing the command `git push amverum master`. To avoid the error, it is enough to specify from which branch the changes should be pushed: ```shell git push amverum main_branch_name:master ``` So, for example, if the main branch is called `main`, the command would look like this: ```shell git push amverum main:master ``` To find out what the main branch is called (assuming you are on it): ```shell git branch --show-current ``` ```{eval-rst} .. admonition:: Note :class: hint Other common errors when working with Git are collected at :doc:`link ` ``` ### If you encounter an error or something is unclear to you - Check out the [Frequent Errors](../git/freq-errors.md) section when working with Git