09 Jun Version Control System
Version Control System
What is a version control system?
Version control, also known as “source code control,” is the practice of tracking and managing changes to software code. Version control systems are software tools that help software teams manage changes to source code over time. As development environments accelerate, version control systems help software teams work faster and smarter. They are especially useful for DevOps teams, helping them reduce development time and increase successful deployments.
Benefits of version control systems:
- A complete long-term change history of all files.
- Creation of branches and merges.
What is Git?
Git is a free and open source distributed version control system designed to handle everything from small projects to very large projects quickly and efficiently.
Advantages of using Git
Disadvantages of using Git
- Learning curve.
- Number of commands.
- Meanings of commands.
- Initialize an empty repository in a specific folder.
- Add a specific file.
git add “filename”
- Add all files in the directory.
git add .
- Commit the changes made. The “message” is generally used to associate the commit with a brief description of the changes made.
git commit –am “message”
- Upload the branch “branch_name” to the remote server.
git push origin “branch_name”
- Revert the commit identified by “hash_commit”.
git revert “hash_commit”
- Show the current status of the branch, such as what changes there are without committing.