You are viewing an older revision! See the latest version
Compiler Version Control
You can use the version control features to let you version, branch and merge code, with a nice representation of the state of your project history:
The approach should be familiar to those of you with experience of distributed version control models (as used by mercurial/git); each program and library has its own local repository, so you can commit and perform actions on it within your own workspace (such as switching, branching, showing changes).
The main things you can do with a local repository include:
- Commit a version of your project, and view the revision history
- View changes a version made, and compare changes between versions
- Switch and revert to a different version
- Branch and merge versions
Notice
You can also do collaboration aspects with this - fork, push, pull, send pull request. These are covered in the Collaboration wiki pages.
Your program is the "Working Copy". You can "Commit" changes to its local repository to create new "Revisions".
You can choose to "Switch" to a particular revision, which updates your working copy to that revision (e.g. a state of your program in the past). This is the way you can "Branch"; do some commits, switch to a previous revision, do some more commits; you now have two branches of development derived from a common revision.
You can then "Merge" a revision, often the head of one branch, in to your working copy. This creates a working copy that is the merge of these two branches, and when you commit, your back to one (less) branch of development.
There is also the option to "Discard" your working copy, and "Revert" your working copy to a particular revision; unlike "Switch", this creates a working copy with the changes you need to get back to that previous state, more like an "undo" than a branch.
You can see the changes between your current working copy to the previous revision, and changes between revisions.
Here is the video that shows how you get started: