Term 2 week 9 Working in teams Flashcards
what is scm (source code management) / version control
Source Code Management (SCM), also known as Version Control, is a system that
manages changes, tracking the history and evolution of those files over time.
best practices
. include commit messages
.commits have one function ( rather than having a commit that has a lot of new features)
. work with most up to date version - ( eg if you are working on an old version and someone has made changes to something you are currently making changes to in new version will cause conflict
. save ur changes frequently - gives others the advantages addressed in above bullet point - saves them from addressing conflicts etc
. test before submission ( so bugs dont break system when you commit
benefits of version control
Collaboration: multiple developers to work on the same project simultaneously without overwriting each other’s work.
- Backup and Restore: If something goes
wrong, developers can revert to a previous version of the code that worked correctly. - History and documentation: Offers a detailed history of the changes, including who made each change, when they made it, and why (if commit messages are used effectively).
- Branching and Experimentation: Encourages experimentation by allowing developers to create branches. This way, they can work on new features or bug fixes without affecting the main code base until the new work is ready to be merged.
what is a git repository
storage location that stores your projects files and each files revision history
what does git commit do
creates a ‘snapshot ‘ of the project at that time
contain:
- author
- time
git message ( what changed from the previous commit)
git commit vs push
git commit - saved to local repository
git push - saved to remote repository ( allowing others to see changes)
what is usually more frequent the commit or push
The commit is more frequent:
- You want to commit whenever you have added a new functionality/ unit which is saved to your local repository
- only once you want what you have to be shared to others do you push - > this goes to remote repository
branch
lets say you have your master (main) branch
Branching allows you to experiment and add new features but not in the main code base incase a bug destroys everything
branching:
- basically copies the current sate of the main branch
- then the user can make changes/ experiment
- when hes happy he merges back
merge
integrating changes from one branch to another
conflict
A conflict arises when two or more changes compete with each other. This often
happens during a merge if two branches have made edits to the same line of a file
or if one branch deleted a file while another modified it. Conflicts require manual
intervention to resolve.
. Pull Request (PR) / Merge Request (MR)
a request to merge a branch into master branch
- allows your edits to be put up for review before placing it in main
checkout
switches branches
clone
Cloning is the act of copying a repository from a remote location to your local
machine. This allows you to work on a project locally.
centralised
project and its versions stored on a centralisesed repository
developers make changes and commit to central repository
relies on network connection to the central server,
decentralised
developers have copy of project and history on their own local machines as well ( so they can work independently of network connection to a central server
Collaboration occurs through exchanging changes between repositories,