In order to use version control in Monaca Cloud IDE, you will need:
In this section, you will learn how to link Monaca account to your GitHub account. Please proceed as follows:
Go to Your profile name → GitHub Integration .
Click on Link button. You are required to login with your GitHub account before being redirected to GitHub’s Authorize Application page.
In the Authorize Application page, you will be asked to authorize the application in order to link Monaca account to GitHub. Click on Authorize application to proceed.
Now your Monaca account is successfully linked to your GitHub account.
Go to your GitHub account and create a new empty repository (without Readme file).
Assuming that you have successfully integrated your Monaca account to GitHub account, you need to do some configurations in Monaca Cloud IDE in order to connect your project to your repository.
Please follow the configuration instruction below:
Select your remote empty repository. Then, click on Initialize button to save the configuration.
Your project is then being uploaded to your new repository in GitHub. By default, your working branch will be configured as master. If you want to switch to another working branch, please go to Version Control Configuration page ( Version Control → Configure... ).
Once you have linked your Monaca account with GitHub, you can import any existing projects from GitHub repositories to Monaca Cloud IDE.
In Import Project dialog, fill in the necessary information and
Import from GitHub Repository. Then, select the repository
and click on Import button.
If the import is successful, the new project will be added to Monaca Dashboard. By default, master branch will be applied to the imported project. You can switch the current working branch in the Version Control Configuration page ( Version Control → Configure... ).
Once you have successfully connected your project with a repository, you can start working on the same project with your team members and keep it synchronized to the latest updates in Monaca Cloud IDE.
Monaca Cloud IDE provides a very user-friendly interface supporting version control of your code. Without learning Git from the scratch, you can still perform some basic Git commands directly from the IDE.
If you have more than one branch and want to switch the current working branch, please do as follows:
Choose the branch you want to switch to from current working branch, and click Save button.
If you are familiar with Git commands, retrieve changes from remotes
here refers to
git pull command. In order to retrieve the changes from
remotes, from Monaca Cloud IDE menu, go to
Version Control → Pull
there are changes in your remotes, you will receive those updates in
your working branch.
wwwfolder. Files outside of this folder are also synced even though they will not appear in the IDE.
After making changes in the current working branch, you are able to commit them back to your remote repository. To commit your changes, please do as follows:
In order to see full history of your previous commits in remote repository, go to Version Control → Show Remote History . You will be redirected to the remote Git service provider’s website showing a commit history of your current branch.
Every commit you made in your Monaca Cloud IDE is called Local Commit. You are able to view your local commit history through Version Control → Show Commit History . To view the changes in each commit, click on the commit on the left panel.
If you want to unlink your Monaca account from GitHub, just click on Unlink button in Link to GitHub page.
If you accidentally revoke Monaca access with Github account, attempt to re-link with the steps described in Setup will not be possible. You will see the following error:
Therefore, in order to re-link your account in this case, please do as follows:
Go to Monaca Login page and choose Sign in with GitHub.
Fill in your GitHub account information.
Then, you will be redirected to GitHub’s Authorize Application page. Click on Authorize application to proceed.
After this, your Monaca account should be successfully linked to GitHub account. You can confirm in the Link to GitHub page. It should appear like this: