---
title: "Working with code"
date: "2024-02-14T06:18:38+00:00"
summary: "Learn efficient code workflows and deployment processes for your project. Discover how to push code, manage environments, and use ach-cli for production deployments in this comprehensive guide."
image:
type: "page"
url: "/service-offerings/working-code"
id: "6c02d2b5-84f5-48a9-9bb4-95904a4e22fc"
---

Code workflows
--------------

Each application has its own git repository connected to workflows that deploy to application environments when you push specific branches or tags.

Pushing code for deployment
---------------------------

To commit your project code:

1.  Set up the [SSH key for the code repository](/service-offerings/china-managed-services/environments).
    
2.  Add the git remote to your deployment artifact repository.
    
3.  Push your deployable branches to the git remote.
    

By default, any commits to the **dev** branch automatically trigger the code deployment to the Dev environment, while the **stage** branch triggers the Stage environment deployment. You can contact Acquia Support to change the branch/environment mapping.

Important

If your project uses php composer, commit the vendor folder to the repository as well.

Production environment deployment
---------------------------------

Deployments to production are not triggered by git pushes. They require SSH access to the production task server and use [ach-cli](/service-offerings/china-managed-services/ach-cli).

### Deployment with ach-cli

1.  Log in to Task Server through SSH.
    
2.  Run the deploy sub-command to deploy a branch (-b) to a specific environment (-e):
    
        ach-cli deploy -e <environment> -b <branch>
    
    For example, to deploy the “release” branch to the stage environment, run:
    
        ach-cli deploy -e stage -b release
    
    Important
    
    If your automated workflows are configured to automatically deploy from a different branch such as stage, then pushing to that branch triggers the deployment and overwrites the release from this branch.
    
    To request changes to mappings, [create a Support ticket](/service-offerings/support#contact-acquia-support).
    
    To deploy the “release-1.2.0” tag to the production environment, run:
    
        ach-cli deploy -e production -b release-1.2.0