MYHOSPITALNOW.COM

Find Trusted Doctors & Hospitals

Discover healthcare providers, compare hospitals, and explore treatment options worldwide.

Free Treatment Quotes • Doctor Search • Hospital Comparison

Find Healthcare Options

www.myhospitalnow.com

What is Git and How it works? An Overview and Its Use Cases?

What is Git?

Git is a free and open-source distributed versions control system use to handle small to very laravel projects code enabling multiple developers to work together. Git additionally makes cooperation simpler, permitting changes by numerous individuals to be generally converged into one source. Git is generally utilized for both open source and business programming improvement, with huge advantages for people, groups and organizations.

History & Origin of GIT

History. Git development began in April 2005, after many developers of the Linux kernel gave up access to BitKeeper, a proprietary source-control management (SCM) system that they had been using to maintain the project since 2002.

How Git works?

  1. Initialize a Git repository: You can initialize a Git repository in a directory by running the git init command. This creates a hidden .git directory in your project folder, which contains all the metadata that Git uses to keep track of your files.
  2. Track files: Once you have a Git repository, you can start tracking files by adding them to the staging area with the git add command. This tells Git to start tracking changes to those files.
  3. Make changes: You can modify files in your project folder as you normally would. Git will keep track of any changes you make.
  4. Stage changes: When you’re ready to commit changes to the repository, you can stage them by running the git add command again. This tells Git to prepare those changes for commit.
  5. Commit changes: To actually save your changes to the repository, you can run the git commit command. This creates a new commit in the repository with the changes you’ve staged.

Git Architecture and Workflow?

In Git, there are three main areas where changes to files can be tracked: the workspace, the staging area, and the repository.

  1. Workspace: The workspace is where you edit your files. It’s simply the directory on your local machine where your project files are stored. Any changes you make to your files in the workspace are not tracked by Git until you add them to the staging area.
  2. Staging area: The staging area, also known as the index, is a temporary storage area where Git tracks changes to files that are ready to be committed. When you use the git add command, Git adds the changes you’ve made in the workspace to the staging area. Once you’ve added all the changes you want to commit, you can then use the git commit command to permanently save those changes to the repository.
  3. Repository: The repository is where Git permanently stores your project files and their complete history. When you commit changes in Git, a new snapshot of your project files is created and stored in the repository. This snapshot includes all the changes that were added to the staging area. You can use the git log command to view the commit history of the repository, which shows all the changes that have been made to the files in the repository over time.
Git workflow: working directory to staging area via git add, then to repository via git commit


Git commands – BytesofGigabytes
Hand-drawn sketch of files moving from workspace to staging index with add, then into the .git repo with commit
Git status output annotated to show staged, modified and untracked files in staging and working directory

Use case of Git

  • Tracks history
  • Free and open source
  • Supports non-linear development
  • Creates backups
  • Scalable
  • Supports collaboration
  • Branching is easier
  • Distributed development

Feature and Advantage of using GIT

  • Tracks history.
  • Free and open source.
  • Supports non-linear development.
  • Creates backups.
  • Scalable.
  • Supports collaboration.
  • Branching is easier.
  • Distributed development.

Best Alternative of GIT

  • Azure DevOps Server.
  • Helix Core.
  • AWS CodeCommit.
  • Subversion.
  • Rational ClearCase.
  • Mercurial.
  • Micro Focus AccuRev.
  • CVS.

Best Resources, Tutorials and Guide for GIT

  • DevOpsSchool
  • Udemy
  • learngitbranching
  • pluralsight
  • codecademy
  • educative

Interview Questions and Answer for GIT

  1. What is the use of the git config command?

    The git config command is used to set git configuration values on a global or local system. It alters the configuration options in your git installation. It is generally used to set your Git email, editor, and any aliases you want to use with the git command.

2. What is a git repository?

A repository is a file structure where git stores all the project-based files. Git can either stores the files on the local or the remote repository.

3. What is ‘git add’ is used for?

‘git add’ adds file changes in your existing directory to your index.

4. What is git Is-tree?

‘git Is-tree’ represents a tree object including the mode and the name of each item and the SHA-1 value of the blob or the tree.

5. What is the use of ‘git log’?

To find specific commits in your project history- by author, date, content or history ‘git log’ is used.

Jobs & Salary Prospectus of GIT skills

GitHub salary table by level, experience and total compensation, ranging from 4,000 to 7,000

Best Certifications in GIT

freecodecamp
ScmGalaxy
DevOpsSchool
mygreatlearning
intellipaat

Free Video Tutorials of GIT

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services — all in one place.

Explore Hospitals
I'm Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked at Cotocus and regularly write about technology, travel, investing, health, product reviews, and digital marketing through my various platforms. I publish technical articles at DevOps School, travel stories at Holiday Landmark, stock market insights at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow, and SEO and digital marketing strategies at Wizbrand.

Related Posts

Git Tutorials: Merge code between multiple repos

To merge code from one Git repository into another, add the second repository as a remote, fetch it, and merge its branch into your target branch with…

Read More

Shell script to git add and commit and push each directory at a time

This page shows how to use a Bash script to stage, commit and push changes one directory at a time. That can mean a folder full of…

Read More

How to Work with Rundeck Webhooks?

A Rundeck webhook is a project-level HTTP endpoint. When it receives a POST request, a handler plugin runs, usually one that starts a job and passes values…

Read More

AWS Tutorials: Working with Code Commit

AWS CodeCommit is a managed, private Git hosting service. You create a repository in a Region, sign in with IAM-based credentials, and then use normal Git commands…

Read More

Git Tutorial: Git Index

The Git index, also called the staging area or cache, is the binary file .git/index. It records exactly what your next commit will contain: each tracked path…

Read More

Git Lab Exercise & Assignment: Git cherry-pick: Part – 12

git cherry-pick copies one or more existing commits from another branch and applies them as new commits on your current branch. This lab corrects and completes the…

Read More
Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
0
Would love your thoughts, please comment.x
()
x