89 questions
-3 votes
2 answers
119 views
should git checkout work when the index is dirty?
I created a branch to do some work on, tried to merge another branch into it, and immediately ran into an insurmountable merge conflict. Clearly the thing to do was abandon the branch and start over. ...
2 votes
2 answers
256 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 ...
1 vote
0 answers
217 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....
3 votes
0 answers
575 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 ...
0 votes
1 answer
294 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?
5 votes
1 answer
1k 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/...
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 ...
0 votes
0 answers
2k 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 ...
1 vote
1 answer
283 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 ...
3 votes
1 answer
246 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 ...
0 votes
1 answer
714 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 ...
3 votes
1 answer
733 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....
5 votes
1 answer
1k 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) ...
0 votes
2 answers
111 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 ...
0 votes
0 answers
39 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 ...