'Segmentation fault for git commit command (Windows)
I have started to work with project, which I cloned from bitbucket. I use as Git Bash, as SourceTree. I changed one file and try to commit my change. I can execute the command "add", but when I try to execute the command "commit" (git commit -m "for testing"), I get the following error: Segmentation fault.
I got an error in SourceTree too. But if I create my new folder & file, the commit happens successfully
How I can fix the problem situation? Thanks in advance.
Solution 1:[1]
I have resolved the problem. The last git version (2.13.1) has the bug - it has been released 05.06.2017. I installed previous version (2.12.2) and now all is OK.
Solution 2:[2]
Running git 2.15.1.windows.2 on Windows 10 x64 v1709
For me the problem was caused by a faulty index. To resolve I ran the following from the project directory:
rm .git/index
git reset
As you can see from the image in this link, I didn't loose any changes by performing a reset.
Solution 3:[3]
If you already have Git installed, you can get the latest development version via Git itself:
git clone https://github.com/git/git
but this didn't work for me.I uninstalled the git and then again downloaded then my problem got resolved.
Solution 4:[4]
I had the same issue on some project, I could no checkout a new or an existing branch. I installed the latest version of git from the website and now my version is
> git --version
git version 2.13.1.windows.2
The issue seems fixed with this build. For now.
Solution 5:[5]
use git reset SHA --hard
Where SHA points to a valid SHA before the error
Changes done after this point is lost. But repo is saved.
Solution 6:[6]
For me the problem was caused by a faulty index.
With Git 2.36 (Q2 2022), you will see more details instead of a segfault.
Git now check the return value from parse_tree_indirect() to turn segfaults into calls to die().
For clone/checkout, but can also be applied to commit.
See commit 8d2eaf6 (01 Mar 2022) by Glen Choo (chooglen).
(Merged by Junio C Hamano -- gitster -- in commit bde1e3e, 13 Mar 2022)
checkout, clone: die if tree cannot be parsedSigned-off-by: Glen Choo
When a tree oid is invalid,
parse_tree_indirect()can returnNULL.
Check forNULLinstead of proceeding as though it were a valid pointer and segfaulting.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Natalija P |
| Solution 2 | Peter Wanden |
| Solution 3 | Priyanka Lalge |
| Solution 4 | kalnic29 |
| Solution 5 | regina_fallangi |
| Solution 6 | VonC |
