How To Remove A File From The git Staging Pre-Commit List

Published Date Author: , Posted May 31st, 2019 at 4:07:10pm

Quickref: How to Remove a file from the staging area

The Story

Recently, I accidentally added some files to git’s pre-commit phase, i.e.:

For example, here is how to handle the above situation:

To better understand, here are the phases/states/stages that git uses:

  • Untracked – when a file is first created, git sees it and knows it has not yet been told to handle this file
  • Staged/Indexed – git add will signal git to start tracking the file, and so git places the file into the staging state, ready to commit
  • Committed – the git commit command can be called upon a single file or use -a to commit all staged files
  • Modified- a file has already been committed at least once before, and now new changes exist in the local file(s) which are not committed or staged yet.

No comments as yet.

Leave Your Comment  Leave a comment

All fields marked with "*" are required.