By using this site, you agree to the Privacy Policy and Terms of Use.
Accept
World of SoftwareWorld of SoftwareWorld of Software
  • News
  • Software
  • Mobile
  • Computing
  • Gaming
  • Videos
  • More
    • Gadget
    • Web Stories
    • Trending
    • Press Release
Search
  • Privacy
  • Terms
  • Advertise
  • Contact
Copyright © All Rights Reserved. World of Software.
Reading: 12 Interview Questions to Teach You How Git Works | HackerNoon
Share
Sign In
Notification Show More
Font ResizerAa
World of SoftwareWorld of Software
Font ResizerAa
  • Software
  • Mobile
  • Computing
  • Gadget
  • Gaming
  • Videos
Search
  • News
  • Software
  • Mobile
  • Computing
  • Gaming
  • Videos
  • More
    • Gadget
    • Web Stories
    • Trending
    • Press Release
Have an existing account? Sign In
Follow US
  • Privacy
  • Terms
  • Advertise
  • Contact
Copyright © All Rights Reserved. World of Software.
World of Software > Computing > 12 Interview Questions to Teach You How Git Works | HackerNoon
Computing

12 Interview Questions to Teach You How Git Works | HackerNoon

News Room
Last updated: 2025/10/01 at 2:11 AM
News Room Published 1 October 2025
Share
SHARE

Version control systems, such as Git, are among the main technologies for a frontend developer. Learning the use of version control systems is very important in order to pass technical interviews. In this article, we will go over 12 interview questions on Git and their concise answers so that you can have a better idea about how Git works and be better prepared for your next interview.

1. What is Git, and what is it used for?

Git is a Distributed Version Control System that allows developers to track changes in code, enabling project development in an articulated manner. Git can be used for team collaboration, management of branches, creation of commits, and conflict resolution.

2. What is git-flow?

Git-flow is a branching model and workflow that solves the management of releases, features, and hotfixes in the project. The whole idea behind git-flow is to split the branches into the major branch master (or main) and a development branch develop, while other branches, if needed, must be created for features, releases, or bug fixing.

Key git-flow branches:

  • Master (Main): the stable branch where the final releases go.
  • Develop: current development server is here.
  • Feature branches: new features are developed here.
  • Release branches: Branches for preparing releases.
  • Hotfix branches: Branches for critical bug fixes.

3. How does interaction with Git usually look like?

The usual interaction with Git goes through the following states:

  1. Creating a new branch: this helps in isolating the work on a new feature (git branch or git checkout -b).
  2. Modifying files: The code is modified, changes are staged inside staging area (git add).
  3. Committing: saving changes with a descriptive message (git commit -m)
  4. Pushing to remote: send changes to the remote repository (git push).
  5. Pull from remote repository: sync your local repository with changes present in the remote (git pull).

4. What is a Staging area in Git?

This is an intermediary area in Git where all changed and added files with the git add command are placed before a commit. It’s like a “draft” of changes before they are saved officially. Accordingly, developers can add to this area only those files or lines of code that are prepared for a commit, excluding others if necessary.

5. What is the difference between git merge and git rebase?

Both git merge and git rebase are used to integrate changes from one branch into another, but they work differently:

Git merge: Creates a new merge commit that ties together the history of both branches. It preserves the branching history, showing where the codebase diverged and came back together.

git checkout feature-branch
git merge main

This will merge the changes from main into the feature-branch with a merge commit.

Git rebase: Rewrites the commit history by “moving” your branch on top of the latest commits from another branch, effectively linearizing the history.

git checkout feature-branch
git rebase main

This will replay your branch’s commits on top of main, avoiding the need for a merge commit.

Key difference: git merge preserves history and shows where branches diverge and come together, while git rebase creates a cleaner, linear history without merge commits.

6. What is git cherry-pick?

git cherry-pick– command that takes some existing commit and applies it to the current branch. It’s useful when you want to bring over just one commit, or a few, without merging an entire branch.

git cherry-pick <commit-hash>

This will apply the changes from the specified commit onto the current branch.

Cherry-picking is useful in cases where you need to apply a bug fix from one branch to another without merging all other changes that branch may contain.

7. Have you ever had to do anything unusual in Git?

This is an open-ended question. You can answer this based on your experience. Examples of less common tasks may include rewriting the commit history using git rebase, manually resolving tricky merge conflicts, recovering a deleted branch or commit, removing large files from repository history in order to reduce size.

8. How do you make Git forget about something?

There are several ways to make Git “forget” a file or directory:

  1. Stop tracking a file: If a file was added to the repository, but you want Git to stop tracking it, use:
git rm --cached <file>
  1. Remove a file from history in the repository: To completely remove a file from your history, you can use git filter-branch, git rebase, or tools such as BFG Repo-Cleaner.
  2. Ignore the file in the future: Add the file to .gitignore to stop tracking it moving forward.

9. What are Conventional Commits and why do they exist?

Conventional Commits are standardized rules to create commit messages. Conventions keep the history of the changes made in the repository readable and straightforward. An adequately designed commit message puts context to these changes, whereby a teammate can start to understand not only what has changed but why and within what greater context the changes were committed. A popular convention is Conventional Commits. The format is as follows:

<type>(<scope>): <description>

Where:

  • type: defines the type of commit, such as feat for new features, fix for bug fixes, and docs for changes in documentation.
  • scope: an optional section that defines the specific area of the project where the change took place. Example areas include buttons or authentication.
  • description: a short message about the change.

Example commit message:

feat(auth): add OAuth2 support

Advantages of commit conventions:

  • They make it easier to read and follow changes made to a codebase.
  • They tell you at a glance the nature of the changes: feature, fix, breaking change, etc.

10. How would you manage huge binary or frequently changing files within a Git repository?

Large binary files or files which frequently change are poorly handled by Git because Git is optimized to track changes in a very efficient manner on files. Below are some tactics to handle such kind of files:

1. Using .gitignore:

If the file doesn’t have to be under version control, it is better to first put it in .gitignore so Git won’t track it.

2. Git Large File Storage (Git LFS):

Git LFS is an extension to Git that replaces large files in your repository with lean references, while storing the large files separately on a server. This way, you can version large files without bloating the repository.

   git lfs install
   git lfs track "*.psd"
   git add .gitattributes

3. Repository Splitting:

If the repository becomes bloated with binary files, it may be better to split them into another repository. This will keep your code base light and easy to clone.

4. External Storage:

Store large assets elsewhere-in cloud storage, such as AWS S3-and link to them from within your repository, rather than committing them directly.

11. How do you undo the last commit but keep the changes in the working directory?

To revert to the last commit while still keeping the changes inside your working directory, execute the command below:

git reset --soft HEAD~1

12. What is a pull request, and how do you create one?

The Pull Request basically means to pull changes from one branch into another. This generally happens via some online platforms such as GitHub and GitLab. A PR involves code review, comments, and the opportunity for discussions before changes get merged into the main branch.


This includes some of the questions about the most important nuances of working with Git that may arise in an interview. Knowledge of Git is so important for a developer that it allows them to successfully cooperate with other developers, taking care of the project as a whole.

Make sure you know not only how the commands are spelled but also how they work in a real project.

Sign Up For Daily Newsletter

Be keep up! Get the latest breaking news delivered straight to your inbox.
By signing up, you agree to our Terms of Use and acknowledge the data practices in our Privacy Policy. You may unsubscribe at any time.
Share This Article
Facebook Twitter Email Print
Share
What do you think?
Love0
Sad0
Happy0
Sleepy0
Angry0
Dead0
Wink0
Previous Article Nothing owners can now try Android 16 thanks to Nothing OS 4.0 open beta
Next Article U.S. government takes stake in Canadian lithium miner and its Nevada mining project | News
Leave a comment

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Stay Connected

248.1k Like
69.1k Follow
134k Pin
54.3k Follow

Latest News

Tesla raises price of Model 3 Long Range in China · TechNode
Computing
Latest Airline Security Breach Leaks Passports, IDs, Other Info
News
Sony top headphones and earbuds are getting Gemini Live and audio sharing via Fast Pair
News
Chpter co-founders Tesh Mbaabu and Mesongo Sibuti exit
Computing

You Might also Like

Computing

Tesla raises price of Model 3 Long Range in China · TechNode

1 Min Read
Computing

Chpter co-founders Tesh Mbaabu and Mesongo Sibuti exit

4 Min Read
Computing

How PDE Motion Models Boost Image Reconstruction in Dynamic CT | HackerNoon

9 Min Read
Computing

DJI launches FC100 delivery drone with 80kg payload, starting at $12,500 · TechNode

1 Min Read
//

World of Software is your one-stop website for the latest tech news and updates, follow us now to get the news that matters to you.

Quick Link

  • Privacy Policy
  • Terms of use
  • Advertise
  • Contact

Topics

  • Computing
  • Software
  • Press Release
  • Trending

Sign Up for Our Newsletter

Subscribe to our newsletter to get our newest articles instantly!

World of SoftwareWorld of Software
Follow US
Copyright © All Rights Reserved. World of Software.
Welcome Back!

Sign in to your account

Lost your password?