DEV Community

Hari Krishnan
Hari Krishnan

Posted on

FSD 1.1.3 - Setting up Version Control

What is version control ?

Version Control is very important for any developer to keep track of code changes and simplify code management when we work with a team of developers.

It supports

  1. Tracking Changes: Records changes to files over time, allowing you to see what changed, when, and by whom.

  2. Collaboration: Allows multiple people to work on the same project without conflicts.

  3. History: Keeps a record of changes, enabling you to revert to previous versions.

  4. Branching: Lets you create separate branches for new features and merge them later.

Why do we need Version Control?

  1. Collaboration: Multiple people can work on the same project without overwriting each other’s work.

  2. Backup: Safeguards your code by allowing you to revert to a previous working state.

  3. Tracking: Helps monitor project progress and identify when issues were introduced.

  4. Experimentation: You can test new features safely using branches without affecting the main codebase.

In a development team, think of version control like a shared codebase where multiple developers work on different features (branches) without overwriting each other’s work. If a bug is introduced, you can track changes, revert to a previous version, and merge the new features once they’re tested and ready. It ensures smooth collaboration and helps manage project history.

To implement version control in this course, we will be using Git. Git is a distributed version control system used to track changes in code and manage source code history.

Git is the foundation for platforms like GitHub, GitLab, and Bitbucket, which provide additional collaboration tools like pull requests and issue tracking.

We will be using Github as the platform for application development.

CREATING A GITHUB ACCOUNT

Sign up with Github and choose a free plan in this link - https://github.com

SETTINGS UP GIT on macOS

Install Git:

  • Open the Terminal.
  • Check if Git is already installed by running:
git --version
Enter fullscreen mode Exit fullscreen mode
  • If not installed, Git is often pre-installed on macOS. If it’s not, install it via Homebrew:
brew install git
Enter fullscreen mode Exit fullscreen mode

Configure Git:

Set your global username and email for Git (used for commits):

git config --global user.name "Your Name"
git config --global user.email "youremail@example.com"
Enter fullscreen mode Exit fullscreen mode

Verify Configuration:

  • Verify your settings:
git config --list
Enter fullscreen mode Exit fullscreen mode
  • Verify the installation
git --version
Enter fullscreen mode Exit fullscreen mode

SETTINGS UP GIT on Ubuntu

Install Git:

  • Open the Terminal.
  • First, update the package list:
sudo apt update
Enter fullscreen mode Exit fullscreen mode
  • Install Git:
sudo apt install git
Enter fullscreen mode Exit fullscreen mode

Configure Git:

  • Set your global username and email for Git (used for commits):
git config --global user.name "Your Name"
git config --global user.email "youremail@example.com"
Enter fullscreen mode Exit fullscreen mode

Verify Configuration:

  • Verify your settings:
git config --list
Enter fullscreen mode Exit fullscreen mode
  • Verify the installation
git --version
Enter fullscreen mode Exit fullscreen mode

Top comments (0)