APURV
  • Home
  • Journey
  • Projects
  • Blogs
  • Interview
  • Exams
Resume
APURV

Building scalable, secure, and production-ready cloud infrastructure. Automation first.

NAVIGATION

HomeExperienceProjectsCertificationsSkills

TECH STACK

AWSGCPK8sCI/CDLinuxDocker

CONNECT

LinkedInGitHubEmailResume

© 2026 Apurv Gujjar. All rights reserved.
Apurv Gujjar
Apurv GujjarDevOps & Cloud Engineer
|Interview Documentation
Portfolio
Handbooks
🎯Linux🐙Git & GitHub🤖GitHub Actions🌐Networking☁AWS🛠Terraform🐳Docker☸Kubernetes📊Monitoring🛡DevSecOps💰Cost Optimization🚨Incident Scenarios👤HR & Behavioral☁GCP🐍Python
Interview DocumentationGit & GitHubWhat actually happens under the hood when we execute a 'git commit' command?
Back to all Git & GitHub questions
Q6

What actually happens under the hood when we execute a 'git commit' command?

💬Answer

When you execute git commit -m "commit message", Git performs several actions behind the scenes:

  1. Gather Staged Files: Git looks at the staging area (index) to compile the snapshot.
  2. Create tree objects: Creates directory structure records mapping file names to their corresponding file hashes (blobs).
  3. Create a commit object: Writes a metadata file containing:
    • The hash of the root tree object.
    • The hash of the parent commit(s) (unless it is the initial commit).
    • Author and Committer names, emails, and timestamp.
    • The commit message.
  4. Generate SHA-1 hash: Generates a unique 40-character SHA-1 (or SHA-256) hash identifying this commit.
  5. Move HEAD pointer: Updates the pointer of the current active branch (and HEAD) to point to this new commit hash.

Related Git & GitHub Questions

View All Git & GitHubQuestions →
Q1

What is Git, and how does its distributed model differ from older centralized version control systems?

Q2

# Why it is Used:

Q3

What is version control, and why is it considered the absolute starting point for any DevOps pipeline?

Q4

Can you explain the main architectural areas of Git? How do files transition between them?

Apurv Gujjar - DevOps & Cloud Engineer
Created by

Apurv Gujjar

DevOps & Cloud Engineer

Specialized in:DevOpsAWSGCPKubernetesTerraformDocker
View Portfolio