Version Control using Git and Github (Part 1)

  1. Untracked by Git: Untracked files are those that have been created within your repository’s working directory but have not yet been added to the repository’s tracking index using the git add command.
  2. Tracked by Git: Tracked files are that which exist in the Git’s tracking index.
  1. Working Directory — This is the directory in which the project or file is residing. It may or may not be tracked by Git.
  2. Staging Area — When in working directory, the files to be tracked by Git is selected. Staging area is the playground where you group, add and organize the files to be committed to Git for tracking their versions.
  3. Git Directory — After the files to be committed are grouped and ready in the staging area, we can commit these files. Thus we commit this group of files along with a commit message explaining what is the commit about. When committed, a snapshot of the files in the commit is recorded by Git. The information related to this commit is stored in the Git directory. Thus, Git directory is the database where metadata about project files’ history will be tracked.
$ sudo apt-get install git (or)
$ sudo apt-get install git-all
$ git --version
$ git init
$ git add <filename> — to add a particular file in the working                         
directory to the staging area
$ git add . - to add all the files in the working directory to the
staging area
$ git status
$ git commit -m "Commit Message"
$ git log
$ git reset <hash>
$ git reflog
$ git revert HEAD
$ git revert <HASH>
$ git rm <Filename>

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Connect Your Device Over WIFI Instead of USB Cable in VS(Visual Studio) to Debug Your Flutter App

Deploy a KEEP Node to Kubernetes and Monitor with Prometheus & Grafana

Go doesn’t need generics

Your code will be a liability if your types have mediocre names

Swift tutorial: Auto-renewable subscriptions (the easy way)

The Best and Safest way to clean up boot partition-Ubuntu 14.04/16.04/18.04 LTS

Rendering Questions and Answers

My AWS certification experience and some tips

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Raghav Menon

Raghav Menon

More from Medium

Introduction to Jib

Handle multiple databases in bitbucket Pipelines

Creating my news application.

API Gateway — Custom Authorizer arn changes not reflecting — Authorizer Error