each time a program is edited, a new version is created
version control works by tracking changes in a set of files. it allows: working on a local copy, turning back in time, branches of development, merging of branches, tracking who made changes, allowing all changes to exist simultaneously
version control allows recreation of project history and for teams to work together on the same code
a lot of systems run some tests upon remerge
repo = set of files, the version control system tracks them all as just general files (eg. does not care if complies etc.)
version control works much better on text files than binary files
version control typically does not store the whole file on each update, just the changes since the last version to minimise space taken up
each revision has: differences to last version, new version no/id, author, time of checkin, log message
conflict happens when apply(changeA, (changeB, 1.0)) =/= apply(changeB, (changeA, 1.0))
when there is conflict, the later checker in must manually merge the their code to the new version
conflict only checks if the sameline has been changed, not if the thing breaks overall, so no conflict =/= no actual conflict
need (automated) unit tests to catch semantic (not syntax conflict) errors
subversion = centralised, git = distributed
subversion: central server stores repo, user checks out local copy, user checks in changes to main repo. Operations are on the project, not individual files (all or no files checked in, no choosing). Has a version number that ticks up with every commit
Subversion features - rename repo version to a unique name (eg. v2.1), branches
Subversion cons: centralised - if server goes down noone can commit anything, cannot commit locally (eg. offline)
Git: distributed, no central repo required but can be done if wanted (Eg. github). People can push to other people's local repos, and pull changes from other people. Can squish multiple unpushed commits into a single pushed commit
git features: tag labels (proper not just branches masquerading), branches, commits have SHA1 identifiers, easier to hangle conflicts due to local commit, much flexibility