Version Control Flashcards
How does branching work
It’s like having two separate repositories, each branch has its own history and tracks its changes independently. It’s a little more complex.
Why is it better to use branching over trunks
When using trunks, at time of release, some members may be fixing last bugs and evaluation quality
At this time we don’t want to worry about changes affecting future releases, so we could freeze other development but this would be a waste of resources
What is a trunk
The base of a project on which development progresses
Give two advantages of revision tags
Provides text for particularly important revisions
More informative than version numbers
Enables you to look back and know what the different versions were used for since the revision tags will explain this
What is a revision tag
A textual label that can be associated with a specific revision of a project maintained by a version control system
How are versions kept track of
Every time you update your own repository the number increments. (File Specific: version 1.3 of MyProgram.java => 3 changes)
Name differences between centralise repositories and distributed repositories
CENTRALISED REPOSITORY:
Only has two operations - update and commit
Commit to centralised repository - others can see changes immediately
DISTRIBUTED REPOSITORY:
Every developer has a local repository and commits to their own working copy
Changes must be pushed to the central repository
Others have to pull your changes to their own repository - this updates their own working copy
THEORY CARD VERSION CONTROL
A project-wide “undo button”
Code won’t be lost through overwrites - when there are multiple developers working on the same code
Keeps a record of changes - find out who made what changes
Supports multiple releases at the same time - no need to freeze development leading up to a release
Able to support customers if they have problems with previous versions of the software - able to intercept the version of the software at a given date/time
Repository acts as a server - provides a safe and secure place for files to be kept
Can work on the project using local machines - edit the project using client version control tools
Can allow local offline changes - resynchronise code later
Simple way to manage program files - some allow multiple repositories other allow for a single central master repository
Allows for atomic commits (small changes)
Provides documentation - easier to find which methods were created in which version of the software
What does version control do
It records changes over time
Access versions of the same software later
How are files that need to have locks dealt with (e.g. binary files)
The VCS will mark binary files as non-mergeable
With other files that require locks we can manually set a locks on them
When committing a file or directory, all locks that are being held are release
In optimistic locking, what would cause a commit to fail?
If you to commit to a file that has been changed, and you didn’t update your own file before making changes.
What is strict locking
What is optimistic locking
1) Only one person can change a file at any one time
2) Prevents you from overwriting changes that were made by others. Therefore local copies of the project must be updated before you can commit any changes
What is merging
When changes made in branches are combined and made to the main trunk
Bugs fixed in a release can be used to fix the trunk source
What is forking
A copy of a repository with all its code, branches and history on the server.
Often used if there is a split of opinion in the development team