What is git? A beginner’s guide !

Aniket Pal
3 min readNov 14, 2020

Git is a distributed version control system for storing and tracking changes in computer files. This means that git allows many developers to work on the same project without being on the same network. For getting started with opensource it is must.

Git is not a programming language as many new developers do assume. It is only an important tool that every developer should know since its uses will always be found in your entire career as a software developer.

It can be used for programming with Java , Cpp, Python , JavaScript, Dart , Shell ,Go and all other programming languages so it is not language-dependent.

Git is the most widely used version control system in the world.

It is a distributed and actively maintained open source project originally developed in 2005 by Linus Torvalds, the famous creator of the Linux operating system kernel.

The key concepts of git

  1. co-ordinate work between multiple developers.
  2. Revert back changes in committed files or folders.
  3. Enable developers to work on both local and remote projects.

The benefits of using git

  1. Keeps track of all committed code histories.
  2. Takes snapshots of committed files.
  3. Allows developers to visit any snapshot.
  4. Allows developers to delete snapshots.
  5. Allows developers to create branches in projects.

The Important and Basic Git Commands

  1. git init: This command tells git hey I want you to keep track of the files in this folder. it allows us to use the git commands.
  2. git add: allows us to add files to the staging area.
  3. git rm: allows us to remove files from the staging area.
  4. git commit: Allows us to take a snapshot of changes in our files.
  5. git status: This command allows us to see the changes that are both tracked and untracked by git and the current branch.
  6. git log: This command allows us to see all the commits in git and the current branch.
  7. git pull: This command is used to fetch and download content from a remote repository and immediately update the local repository to match that content.
  8. git push: is used to upload content from the local repository to the remote repository.
  9. git clone: This command is used to point to an existing repo and make a copy of that repo in a new directory in our local machine.
  10. git rm: allows us to remove files from the staging area.
  11. git branch: allows us to create a branch in our git repository.
  12. git checkout: allows us to switch current branches in git.
  13. git merge: allows us to merge other branches into the current branch.

A repository is just another name for a folder that is initialized with git. Visit the git documentation for the full git commands.

--

--

Aniket Pal

Sophomore EE NITRKL’23 | Novice developer 😁