728x90

Introduction

In a professional setting, terms like Git, Merge, and Commit are commonly used when working with source code. While I’ve been using Git intuitively, handling errors has been a challenge. So, I’ve decided to take this opportunity to study what Git is and how to use it effectively.

1. What is Git?

Git is a version control system (VCS) designed to efficiently manage source code. It was created by Linus Torvalds, the developer of Linux, and is now widely used for managing software development projects beyond just Linux.

Git’s core functionalities can be categorized into three main areas:

1) Version Control

Git helps track changes in files over time, allowing developers to see who modified what and when. This makes it easy to revert changes and maintain a history of the project.

2) Backup

Git allows users to store a copy of their project on a different machine or server for safety and accessibility.

Some common backup locations include:

  • External storage (USB drives, external hard drives)
  • Cloud services (Dropbox, Google Drive)
  • Remote repositories (GitHub, GitLab, Bitbucket)

3) Collaboration

With Git, multiple developers can work on the same project simultaneously. By using a remote repository, team members can easily share and merge changes without conflicts.

2. How to Install Git (Windows)

To start using Git, you need to install it on your PC. Since Git uses Linux commands, installing Git on Windows also includes Git Bash, a command-line interface for executing Git commands.

Step 1: Download and Install Git

  1. Go to the official Git website: https://git-scm.com/.
  2. Click "Download for Windows".
  3. If the download doesn’t start automatically, click "Click Here to Download"
    .
  4. Run the downloaded file and proceed with the installation using the default settings.

Step 2: Launch Git

  1. Open the Windows Start Menu.
  2. Search for Git Bash and click to launch it.
  3. A terminal window will appear, ready for Git commands.

Step 3: Configure Git

Before using Git, you need to set up your user information, which will be recorded in each commit.

Run the following commands in Git Bash:

# Register user information
git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"

# Verify registered user information
git config --get user.name
git config --get user.email

This setup ensures that your commits are properly attributed to you.

Conclusion

Git is an essential tool for managing source code, enabling version control, backup, and collaboration. Learning how to use Git effectively can greatly improve your workflow and efficiency in software development.

References

Thank you for reading! I hope this guide helps you get started with Git. 🚀

728x90

+ Recent posts