Git
Why Use Git?
Git is a powerful version control system that enables us to:
Save every change permanently in the cloud: Each save, called a commit, records what was changed, when, and by whom.
Track and review history: If a change breaks something, we can examine past commits to find and fix the issue.
Work safely in parallel: Multiple developers can work on different features simultaneously without overwriting each other’s work.
Maintain accountability: We know exactly who made what change, which is helpful for collaboration and debugging.
Important: Commit Often!
Frequent commits with clear, descriptive messages help everyone understand the history and purpose of changes. Not committing regularly risks losing progress and makes debugging harder.
Using Git in VS Code
VS Code offers a built-in graphical interface for Git, making version control accessible without command-line experience.
How to Commit Changes:
Open VS Code and press Ctrl + Shift + G (or click the Source Control icon).
Review the list of changed files.
Stage files to include in the commit by clicking the "+" button or Stage All Changes.
Write a descriptive commit message summarizing your changes.
Commit messages are stored forever, so make them meaningful!
Click Commit to save the changes locally.
Pulling and Pushing:
Pull: Fetches the latest changes from the cloud and merges them into your local copy. VS Code will assist you if there are conflicts to resolve.
Push: Sends your committed changes from your local machine to the cloud repository so your teammates can access them.
Branches
Branches let you create parallel versions of the codebase:
Branches start from a common point and let you develop features or fixes independently.
For example, two developers can work on separate features in their own branches without interfering with each other.
Branches keep unfinished or experimental code away from the stable main branch until ready.
Once tested and reviewed, branches can be merged back into the main branch.
Getting Started
Ask to be added to the team’s GitHub organization. This will give you access to clone repositories, push commits, and collaborate easily.
Clone the repository to your local machine and start making changes!
Last updated