How to use Git to manage your project¶

Your Divio Cloud project is a Git repository, offering several advantages to the developer -fine-grained revision control, excellent collaboration options, easy export and replication.

The Divio app, our desktop application for project management, also usesGit behind the scenes for its Upload and Download operations.
'Upload and download buttons in the Divio app'
If you are familiar with Git, then all you need to know is that your project is a completelystandard Git repository, and:

  • our Git server is git.divio.com
  • by default, we use the branch develop (optionally, different Git branches can be linked toyour Test and Live servers)
    If you use the Divio app or the Divio Shell, SSH keys will be set up for you;otherwise you will need to set them up yourself.

Basic Git operations¶

It’s beyond the scope of this documentation to provide a guide to Git, but to get you started,the basic operations you will need are described here.

Push your changes to the Cloud¶

If you have made some local changes and want to push (i.e. upload) them to the Cloud, the basicsteps you need are:

  • git status to see the changed files
  • git add (etc) to stage the changes (alternatively, you can do git add .to stage everything)
  • git status to make sure everything has been staged
  • git commit -m "" to commit the changes (provide a meaningful message foryour own benefit)
  • git push origin develop to push your local changes to the origin (i.e. our server)

Pull changes from the Cloud¶

  • git pull will pull fetch and merge any changes that have been made on the Cloud

Excluded directories¶

Note that a number of directories and files are excluded (using the .gitgignore file) from the project. They include:

  • .env - the project’s virtualenv, for software installed using pip
  • data - temporary file storage
  • static_collected - processed static files
  • node_modules - for frontend frameworks
  • .env-local

原文: http://docs.divio.com/en/latest/how-to/use-git.html