Version control is a system that records changes to a file or set of files over time so that you can recall specific versions later. It allows you to revert files back to a previous state, revert the entire project back to a previous state, compare changes over time, see who last modified something that might be causing a problem, who introduced an issue and when, and more.
Git is one of the most popular version control systems. It is a distributed version control system that is widely used for open-source and commercial software development. GitHub, GitLab, and Bitbucket are popular Git hosting services.
Download the latest version of Git from the official Git website. Run the installer and follow the installation steps. Alternatively, you can use winget
to install Git by running the following command in PowerShell:
winget install Git.Git
macOS and most Linux distributions come with Git pre-installed. You can check if Git is installed by running git --version
in the terminal.
After installing Git, you need to configure your name and email address. This information will be used to identify your commits. Run the following commands in the terminal or PowerShell, replacing Your Name
and Your Email
with your name and email address:
git config --global user.name "Your Name"
git config --global user.email "Your Email"
Git Large File Storage (LFS) is an open-source Git extension for versioning large files. While Git is great for text files, it's not ideal for large binary files like images, audio files, and datasets. Git LFS replaces large files with text pointers inside Git, while storing the file contents on a remote server. This keeps the repository size manageable and speeds up cloning and fetching.
Download the latest version of Git LFS from the official Git LFS website. Run the installer and follow the installation steps. Alternatively, you can use winget
to install Git LFS by running the following command in PowerShell:
winget install Git.LFS
after installing Git LFS, you need to enable it globally by running the following command in PowerShell:
git lfs install
Download the latest version of Git LFS from the official Git LFS website. Run the installer and follow the installation steps. Alternatively, you can install Git LFS using Homebrew by running the following command in the terminal, and then enable it globally:
brew install git-lfs
git lfs install
Download the latest version of Git LFS from the official Git LFS website. Run the installer and follow the installation steps. Alternatively, you can install Git LFS using your package manager. For example, on Ubuntu, you can run the following commands in the terminal:
sudo apt-get install git-lfs
git lfs install
When contributing to a project on GitHub, you typically follow the Fork and Pull Request Workflow. Here's how it works:
On the GitHub repository you want to contribute to, click the "Fork" button in the top right corner. This creates a copy of the repository in your GitHub account.
2. Clone the Forked Repository
Clone the forked repository to your local machine using
git clone <repository-url>
Create a new branch for your changes using
git checkout -b <branch-name>