Projects
Version Control
Introduction
Version control is the practice of tracking and managing changes to code files. By using version control, you can save an extra back up of your project files in the cloud, keep a history of all code changes, and easily revert changes to your projects.
To use the CLI, you must be a member in an organization on a paid tier.
Create Workspace Repositories
Follow these steps to set up a new version control repository for one of your organization workspaces:
- In your version control system, create a new repository for the organization workspace.
- Open a terminal in your organization workspace and then clone the new repository to a temporary directory.
- Move the .git directory from the temporary directory to the workspace directory.
- Delete the temporary directory.
$ git clone https://github.com/<userName>/<repoName>.git temp
$ mv temp/.git <workspaceDirectory>/.git
$ rm -r temp
Push Changes to Git
Follow these steps to push the changes of your organization workspace to your version control system:
- Pull all your cloud projects, creating directories where necessary.
- Add the project directories and the Library.
- Commit the changes.
- Push the changes to the repository.
$ lean cloud pull
$ git add Library/ $ git add <projectDirectory1>/ $ git add <projectDirectory2>/
$ git commit -am "Latest Updates"
$ git push