Source control
To prevent over-writing each others work when collaborating,
it's common to use a source control management (SCM) system such as Git or Mercurial.
SCM can however be complicated ...
But this editor makes it simple and convenient to use SCM.
With full integrated support for Mercurial,
and with the ability to use Git repositories.
Also see live collaborate editing
How to clone a Git or Mercurial repository
- Select "Clone/add Repo" in the menu.
- Fill in the HTTP or Git Uniform Resource Locator (URL) for the repository (repo), and a folder path for where the files should be saved.
- Click Clone repository
You can make the clone dialog show up automatically by appending ?repo=repourl to the url.
Example: https//webide.se/?repo=git@github.com:Z3TA/2dgeometry.git
Useful for example showing others your code, and letting them clone the repo, and run the code!
Creating a new software repository
There are many services that lets you host your Mercurial or Git code repository (repo) for free, and access it via Hypertext Transfer Protocol (HTTP) or Secure Shell (SSH). For example Bitbucket and Github.
Here's how you create a new repository on Github:
- Login or signup
- Click Start a Project
- Fill in a repository name.
- Click "Create repository"
- Switch to SSH under Quick Setup and Copy the URL for the repo: git@github.com:yourName/nameOfRepo.git
- Right click in the editor and select "Clone a repository"
- Paste the repo URL into the repository field
- Click on the Copy SSH public key button in the editor's clone widget
- If you are asked to generate a new SSH key, click Yes
- If a copy dialog-box comes up, click Manually copy. Then select all the text and click Ctrl+C to copy
- Go to Github settings/SSH keys and click new key
- Paste the SSH public key you just copied. It starts with ssh-rsa and has a bunch of random letters. Then click Add SSH key
- Go to the editor's clone widget and click Clone repository
If you get an error message:
- Make sure you use the SSH git@github.com URL. Or try filling in your Github username and password.
- Make sure the "Clone into" field is a valid folder path.
- If it's a Git repository, make sure the repository URL ends with .git
- If it's still not working, right click in the editor and select "Terminal", and in the terminal type hg clone git@github.com:yourName/nameOfRepo.git
- If nothing works, please contact support
Make a new commit
A commit is a set of changes ...
Edit any of the files in the repository, or add a new file ...
Then click Alt+C or right click in the editor and select "Commit" to show the commit widget.
If there are no "Commit" option in the menu, select "Version control" and then click Commit.
In the commit widget select the file(s) to the left, then write a comment int the box to the right.
It's useful to write why you made the changes, so that you or your colleges can go back and se why the change(s) was made.
Then click
If you are an "expert" you can write hg commit -m "why the change(s)" in the Termial. And then write hg push
Pull new changes
It's a good idea to often pull in changes from the repository. Maybe you made some updates on another editor/computer, or maybe your colleges have pushed updates to the repository.
Right click in the editor and select "Version control".
In the version control widget click Pull & Update to both pull and update/merge.
Hopefully it will be all good and no merge conflicts occurred.
If a merge conflict occured, the editor will guide you through the merge process.
Clicking only "pull" will just download the updates, while "Update" actually updates the files.
If you are an "expert" you can write hg pull && hg update in the Terminal