Source Code Management --- GIT - Global Information Tracker

1. What is Version Control System?

             Version Control / Revision control / Source Control is is a software that helps software developers to work together and maintain a complete history of their work.
                A version control system records the changes you make to your project’s files.

2. Types of Version control system ?

       1. Local Version Control System:
                            The local VCS stores source files within a local system.

       2. Centralized Version Control System:
          Centralized VCS stores the commit or changes in a single server.

3. Distributed Version Control System:
           Distributed VCS stores the changes in local repository and it moves to the remote repository.



3. What is Git ?
                   Git is a DevOps tool used for source code management. 
                  It is a free and open-source version control system used to handle small to very large projects efficiently.
Git is used to tracking changes in the source code, enabling multiple developers to work together on non-linear development.

4. Key Features of Git ?
                   1. Works on Distributed System
   2. Compatiable with all OS.
   3. Allow for non- linear developers ( All around the world any developer can work)
   4. Branching
   5. Reliable

5. Architecture of Git and Workflow of Git ?

1. Working directory - 
            Modify files in your working directory
2. Staging area (Index) - 
           Stage the files and add snapshots of them to your staging area
3. Git directory (Repository)- 
           Perform a commit that stores the snapshots permanently to your Git directory. Checkout any existing version, make changes, stage them and commit.

6. Setting the configuration of Git ?
             Download Git {git website}
                              sudo yum istall git
                              sudo apt install git
             
    To check if git is available or not use:
              rpm -qa | grep git 
              git --version 

Configuration our Credentials:
           When we setup git and before adding bunch of files, We need to fill up username & email and it’s basically git way of creating an account. 
                    git config --global user.name “Karthika”  ( Replace)
                    git config --global user.email “info@gmail.com” (Replace)
    git config --list

7. List of commands used in Git ?
             These are common Git commands used in various situations:  
start a working area:
           git init -  Create an empty Git repository or reinitialize an existing one.
           git clone-  Clone a repository into a new directory.
work on the current change:
           git add       Add file contents to the index
           git mv        Move or rename a file, a directory, or a symlink
           git restore   Restore working tree files
           git rm        Remove files from the working tree and from the index
Examine the history and state:
           git bisect    Use binary search to find the commit that introduced a bug
           git diff      Show changes between commits, commit and working tree, etc
           git grep      Print lines matching a pattern
           git log       Show commit logs
           git show      Show various types of objects
           git status    Show the working tree status
Grow, mark and tweak your common history:
           git branch    List, create, or delete branches
           git commit    Record changes to the repository
           git merge     Join two or more development histories together
           git rebase    Reapply commits on top of another base tip
           git reset     Reset current HEAD to the specified state
           git switch    Switch branches
           git tag       Create, list, delete or verify a tag object signed with GPG
collaborate:
           git fetch     Download objects and refs from another repository
           git pull      Fetch from and integrate with another repository or a local branch
           git push      Update remote refs along with associated objects.

. 8 . What is git merge conflict  ?

Git usually handles feature merges automatically but sometimes while working in a team environment, there might be cases of conflicts such as:

  1. When two separate branches have changes to the same line in a file
  2. A file is deleted in one branch but has been modified in the other.
These conflicts have to be solved manually after discussion with the team as git will not be able to predict what and whose changes have to be given precedence.




Comments

Popular posts from this blog

Important Interview Questions and Answere in Python.

Road Map for Devops - Entry Level , Intermediate Level and Expert Level.