luca.p.alexandru
luca.p.alexandru

Reputation: 1750

Error when trying to reset git HEAD

I a trying to delete the last commit from the local repository by using the

git reset --hard HEAD~1

command. However I get the following error:

fatal: Could not reset index file to revision 'HEAD~1'.

I get

(Filename too long)

for several files. How can I avoid this? I am on Windows

Upvotes: 11

Views: 11045

Answers (1)

VonC
VonC

Reputation: 1324278

Try to see if those error persists with:

git config --system core.longpaths true

Make sure to use the latest git-for-windows (2.7.0), and you should not even need that option.

Upvotes: 9

Related Questions