Introduction to source control
What is source control?
Allows developers to collaborate on code and track changes.
What is version control?
The version control system saves a snapshot of files so that you can review and even roll back to any version of your code with ease. It also helps to resolve conflicts when merging contributions from multiple sources.
Benefits of source control
- Creating workflows: prevent the chaos of everyone using their development process with different and incompatible tools. Version control systems provide process enforcement and permissions, so everyone stays on the same page.
- Working with versions: each new version of code has a message describing what has changed.
- Collaboration: version control makes sure you don't conflict with other changes.
- Maintaining history of changes: self-explanatory.
- Automating tasks: control automation saves team time and generate consistent results.
Common software development values
- Reusability.
- Traceability.
- Manageability.
- Efficiency.
- Collaboration.
- Learning.
Best practices for source control
- Make small changes: commit early and commit often.
- Do not commit personal files: SSH keys or PATs may be stealed.
- Update often and right before pushing to avoid merge conflicts.
- Verify your code change before pushing it to a repository.
- Pay close attention to commit messages: as it will tell you why the changes was made.
- Link code changes to work items: for better traceability.