Git/Github

Git/Github

Introduction:

Git is a popular version control system(VCS).It was created by Linus Torvalds in 2005 and it is maintained by Junio Hamano. Git is used for:-

  • Tracking code change.
  • Tracking who made the change like the history of files.
  • Coding Collaborations.

VCS:

It is a system that records changes made to the file or set of files over the files or set of files over the time so that we can recall the specific version later.

Three types of VCS

  • Local version control system.
  • Centralized version control system.
  • Distributed version control system.

Git Architecture:

There are 3 regions

  • Workplace:-it is a place where developers maintain their source code.

  • Stage Area:-Once the code is ready then it will be added to the stage area.

  • Local Repository:-Once the code is in stage area we commit it to the local repository

github.png

Important operation associated with git:-

  • git init-it creates a folder in the workspace.
  • git status:-to check the status.
  • git add:-it will add your files into the stage area.
             Syntax- git add <fileName>
                          git add . (add all the files)
    
  • git rm:-it is used to unstage the files.
          Syntax:- git rm –cached <fileName>
    
  • git restore:-to restore
                 Syntax:- git restore <fileName>
    
  • git commit:- it is used to commit the file into a local repository .
         Syntax:- git commit -m “some message”