made a disastrous mistake with “create git repo he

2019-01-20 04:35发布

I am new to Git. I have created an account on bitbucket and downloaded TortoiseGit.

I'm on Windows 7 and on the desktop i right clicked and thought "add git repo here" would create an empty folder that could be committed but turns out it has *staged * every folder on the desktop to be committed to master instead.

How do i undo this? Please help!!

4条回答
We Are One
2楼-- · 2019-01-20 05:04

Make sure to turn on Show hidden files in Explorer. Then delete .git directory in your desktop

查看更多
成全新的幸福
3楼-- · 2019-01-20 05:06

Try this

git reset HEAD *

It would unstage all of your files and none of your changes will go away.

查看更多
聊天终结者
4楼-- · 2019-01-20 05:09

Do not run git reset --hard that will delete all the files. Delete the hidden .git folder.

Press Win + R type in cmd and press enter.

cd Desktop
rmdir /S .git
查看更多
劫难
5楼-- · 2019-01-20 05:18

With TortoiseGit 1.8.7.1, a warning message will be added when creating repository on special folders, such as Desktop, drive root, UNC root, User Profile, Windows Directory, system32, Program Files

The Create Repository menu item may be clicked by mistake.

Warning

查看更多
登录 后发表回答