Skip to main content

Questions tagged [git-index]

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.

git-index
1 vote
2 answers
91 views

Pop conflicting Git stash while keeping stash index

Explanation: I make a heavy use of Git staging area to keep track of the changes that I'm already sure of while the working directory is often a mess of untested solutions, TODOs and a code that is ...
Piotr Siupa's user avatar
  • 4,630
1 vote
0 answers
170 views

Removing a submodule manually

I tried removing manually the following submodule from my local repository: components/CtrlFuelSuppHtr Removed it from these three places: .git folder, components folder, and deleted it on .gitmodules....
tadm123's user avatar
  • 8,698
3 votes
0 answers
423 views

Git: Could not reset submodule index when checking out

I'm trying to checkout a specific commit ID along with all its submodules. git checkout --recurse-submodules 7fdb9221d958acda289904951fe6d37873e8cfbf But I'm getting the following error: fatal: not a ...
tadm123's user avatar
  • 8,698
0 votes
1 answer
164 views

For a given Git repository, how do I find the path to its index file?

Suppose that I am running a script inside a Git repository and want to access the index file directly. How can I get the path to the index file, in a way that also respects e.g. worktrees?
Waleed Khan's user avatar
  • 11.5k
4 votes
1 answer
674 views

How can I recover from "invalid sha1 pointer in resolve-undo" with git fsck?

I run git gc in a repository and get a fatal error: Enumerating objects: 2382, done. Counting objects: 100% (2382/2382), done. Delta compression using up to 8 threads Compressing objects: 100% (747/...
Joe's user avatar
  • 30.6k
1 vote
0 answers
31 views

Weird behavior of git switch/checkout if index has same content as target commit [duplicate]

Let's create a small local repository: git init echo foo > foo git add foo git commit -m foo git branch bar echo foo >> foo git commit -a -m 'another foo' If we do this now, we replace our ...
Michi's user avatar
  • 701
0 votes
0 answers
921 views

git error: read error while indexing: Invalid argument

I'm initializing a repo in a Google Drive folder which contains a gsheet file. When I index the folder this error happens: git add . error: read error while indexing file.gsheet: Invalid argument ...
Ooker's user avatar
  • 2,625
1 vote
1 answer
185 views

How can navigate one level back at the git interactive staging (add) command

After running the interactive staging git command $ git add -i and choosing one of the options for example "update", then I don't know how to get back to the root level to choose another ...
muel's user avatar
  • 73
3 votes
1 answer
198 views

Is it possible to apply single lines from stash?

I'm looking for a way to include specific parts of stashes in stage. I'm using TIG frontend, so the method can involve some low level offset, etc. calculation. However currently I don't have any idea ...
psprint's user avatar
  • 359
0 votes
1 answer
476 views

How can I directly and quickly change all the uid/gid of all files in the git index of a git repository

My use case is that I have a very large GIT repository created by uidA:gidA with all its files and git index as uidA:gidA That I have snapshoted/frozen using netapp file system technology aka froze ...
Sarvi Shanmugham's user avatar
3 votes
1 answer
656 views

Why does git checkout file behave like reset staged file followed by checkout unstaged file?

I've come across this statement in git documentation: Checking out a file is similar to using git reset with a file path, except it updates the working directory instead of the stage Link:https://www....
caffein's user avatar
  • 333
5 votes
1 answer
908 views

Can I mark a file for resolution without adding it to the index with one command?

When there's a conflict, git status shows this: Unmerged paths: (use "git restore --staged <file>..." to unstage) (use "git add <file>..." to mark resolution) ...
Enlico's user avatar
  • 26.7k
0 votes
2 answers
101 views

Why does `git update-index` not affect files not in the current directory?

I'm trying to use git update-index --again to re-add modified files to the index. This works fine, but only for files/directories in the current directory. Is this expected behavior for this command ...
planetp's user avatar
  • 15.6k
0 votes
0 answers
31 views

Cloning a git repo that will be the upstream parent but I want to make changes to the README for my new project and not ever push that back

I want to base my new project off of an existing git repo. My intention is not to extend the current project but to start a new project with different aims. Specifically I want to remove the original ...
Evolve's user avatar
  • 9,119
1 vote
2 answers
514 views

How does Git restore index and wokring directory internally (upon reset/checkout)?

I understand that when I checkout or reset --hard to a specific commit/branch then I get the relevant contents in my working directory and the index file. But how does Git internally re-build the ...
caffein's user avatar
  • 333

15 30 50 per page
1
2 3 4 5 6