Also known as staging area, this is where Git keeps changes made to versioned files and what it uses when it creates a new node in history graph (when you do a commit). This is also the reason why git add is so important, as it adds changes to staging area.
Questions tagged [git-index]
89 questions
0
votes
1 answer
Git commit -a is showing all files as deleted
I believe some of the people might have encountered this similar issue.
Suddenly, when I do git commit -a, it states that all my files are deleted and I need to add them back in.
Based on some of the discussions here, it looks like it might have to…

user1805458
- 1,081
- 3
- 9
- 21
0
votes
1 answer
various git states, low-level understanding of git status (head, index, working states)
Imagine you have one tree with one file. Suppose we have only two possible states for this file, a, and b. If it's missing or not-existent, ø. I'm trying to build a table to understand all the possible git-statuses. I believe what I have makes…

pyramation
- 1,631
- 4
- 22
- 35
0
votes
2 answers
How to stage subsequent changes to a file that has already been staged in index?
I made some changes to a file and then staged it in the index for the next commit. Then I realized that I needed some more changes to do. Instead of unstaging it, is there a way to capture these subsequent changes before finally committing?
Would it…

Mohammad Ali Asgar
- 734
- 6
- 16
0
votes
1 answer
How to clear blobs under git/objects after resetting INDEX on initial commit?
In a clean git repo, if I add all untracked files using git add . then git stores all files as blobs under git/objects directory.
Now if I remove files from Index back to working directory using git reset . then it clears the INDEX however the…

dkjain
- 831
- 1
- 9
- 36
0
votes
1 answer
If my staging index is empty, why is `git rm` deleting a file that isn't there?
According to the git rm documentation, this is how it behaves:
Remove files from the index, or from the working tree and the index
If I just did a commit and my index is empty, executing git rm some_file will stage the deletion of some_file. I…

Steve
- 4,446
- 7
- 35
- 50
0
votes
1 answer
how to remove untrack changes but keeping indexed changes
in my git status I see this
Changes to be committed:
(use "git reset HEAD ..." to unstage)
modified: file1
modified: file2
modified: file4
Changes not staged for commit:
(use "git add ..." to update what will be committed)
(use…

user2167582
- 5,986
- 13
- 64
- 121
0
votes
2 answers
How many versions of a file are kept in git when that file is modified?
So I am reading the Version Control with Git, 2nd Edition and I stumbled on this paragraph (page 51, section "Using git add")
Most of the day-to-day changes within your repository will likely be simple edits. After
any edit and before you commit…

matori82
- 3,669
- 9
- 42
- 64
0
votes
1 answer
Git: reset deleted file from index
Create 2 files: one.txt and two.txt.
Commit both files: git add -A and git commit -m "message"
Edit one.txt and add it to index: git add one.txt
Delete two.txt and add it to index: git rm two.txt
I want to commit only one.txt, therefore I need to…

Aleks Ya
- 859
- 5
- 15
- 27
0
votes
2 answers
Git Refreshing Index Error (Aptana Studio 3)
I have been having the problem below for the last couple of days. I am fairly new to git, so I am not sure what is causing this problem.
I do not know where to go from here.
Any help would be appreciated.

Randomishlying
- 1,161
- 2
- 9
- 15
0
votes
0 answers
How to undo a "git update-index --assume-unchanged" on a directory. "--no-assume-unchanged" does not work
I have used
git update-index --assume-unchanged [directory name]
and expected that
git update-index --no-assume-unchanged [directory name]
would undo that command. However, it says "Ignoring path [directory name]" and the directly continues to…

Turo61
- 1
0
votes
3 answers
Making clean commits from a mess of changes in the working tree
Sometimes I end up with a working tree with a lot of changes, mainly after coding in a hurry - the changes are so many that could fit in 20 commits, spread across 2 or three branches. To clean up the working tree and commit everything nicely, I…

CamilB
- 1,377
- 1
- 12
- 27
0
votes
0 answers
git: non-deprecated way of listing skip-worktree files?
The internets recommend git ls-files -v to look for files that were marked as skip-worktree.
Documentation for -v flag of git-ls-files says it's similar to -t flag which is "semi-deprecated".
Is there a non-deprecated (and/or scriptable) way of…

user907059
- 471
- 1
- 4
- 4
0
votes
1 answer
git Bug prevents merge
How can I do a git bisect on a git bug or otherwise restore my git index. Error message first, then failed attempts at a fix below
With GIT_MERGE_VERBOSITY=5 I run git merge origin master and get...
Merging:
9201eee porque no, "not and"
virtual…

hobs
- 18,473
- 10
- 83
- 106
0
votes
1 answer
Git: change only posix permission of file in index
With
git update-index --chmod=+x /path/to/file
I can set (or unset when using -x) the execution bit, but how to set the full permission of the file in the index (e.g. 744)?

Mot
- 28,248
- 23
- 84
- 121