I just Git init'ed a repos with a wrong user, and want to undo it. Is there any command for this? Do I actually have to go in and edit the .git directory?
相关问题
- Why does recursive submodule update from github fa
- Extended message for commit via Visual Studio Code
- Emacs shell: save commit message
- Can I organize Git submodules in a flat hierarchy?
- Upload file > 25 MB on Github
相关文章
- 请教Git如何克隆本地库?
- GitHub:Enterprise post-receive hook
- Git Clone Fails: Server Certificate Verification F
- SSIS solution on GIT?
- Is there a version control system abstraction for
- ssh: Could not resolve hostname git: Name or servi
- Cannot commit changes with gitextensions
- git: retry if http request failed
I'm running Windows 7 with git bash console. The above commands wouldn't work for me.
So I did it via Windows Explorer. I checked show hidden files, went to my projects directory and manually deleted the .git folder. Then back in the command line I checked by running git status.
Which returned...
fatal: Not a git repository (or any of the parent directories): .git
Which is exactly the result I wanted. It returned that the directory is not a git repository (anymore!).
If you just inited it, you can just delete .git. Typically:
Then, recreate as the right user.
remove the
.git
folder in your project root folderif you installed submodules and want to remove their git, also remove
.git
from submodules foldersGit keeps all of its files in the .git directory. Just remove that one and init again.
This post well show you how to find the hide .git file on Windows, Mac OSX, Ubuntu
In windows, type
rmdir .git
orrmdir /s .git
if the .git folder has subfolders.If your git shell isn't setup with proper administrative rights (i.e. it denies you when you try to
rmdir
), you can open a command prompt (possibly as administrator--hit the windows key, type 'cmd', right click 'command prompt' and select 'run as administrator) and try the same commands.rd
is an alternative form of thermdir
command. http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/rmdir.mspx?mfr=true