Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 759
Natalija P Avatar asked Jun 15 '17 13:06

Natalija P


People also ask

What is segmentation fault in git?

Segmentation fault in GitPrograms that try to read or write an illegal location causes segmentation faults a.k.a segfault. Usually, these end up in a program crash. Git also faces segmentation faults. And, these segfaults occur due to various reasons.

What causes a segfault?

A segfault occurs when a reference to a variable falls outside the segment where that variable resides, or when a write is attempted to a location that is in a read-only segment.


2 Answers

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.

like image 95
Peter Wanden Avatar answered Nov 09 '22 05:11

Peter Wanden


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.

like image 5
Priyanka Lalge Avatar answered Nov 09 '22 05:11

Priyanka Lalge