In Git, a commit is a snapshot of your project's files at a specific point in time, effectively saving your work and creating a record of changes, including who made the changes, when, and what they did.
Commits are created with the git commit command to capture the state of a project at that point in time.
Git Snapshots are always committed to the local repository, each developer’s local repository is a buffer between their contributions and the central repository.
Prior to the execution of git commit, the git add command is used to promote or 'stage' changes to the project that will be stored in a commit.
You need to add a new feature file and push it to the repo. Walk me through how you would create a commit for that change.
If you run git commit without specifying a message, what does Git do, and how would you fix it?
During a code review you notice that a recent commit accidentally included a debug log file. How would you remove that file from the commit history without affecting other changes?
Your CI pipeline fails because a commit was made with the wrong author email. Explain how you would amend the commit to correct the author information.
In a large monorepo we have a policy limiting commit size to keep CI fast. How would you enforce and monitor commit size, and what trade‑offs does splitting commits introduce?
When rebasing a long‑running feature branch, you encounter merge conflicts across many commits. Describe how you would resolve them while preserving a clean commit history.
Our organization is migrating from a centralized VCS to Git and wants a consistent commit strategy across dozens of teams. What guidelines would you establish for commit granularity, metadata, and signing, and how would you ensure adoption?
We need to implement a system that automatically validates commit messages against a style guide before allowing pushes to protected branches. Outline the architecture and discuss potential impact on developer workflow.