简体   繁体   中英

How to change Git root directory?

When I installed git, I made a mistake to set c:/users/jack as the root directory. But there're many unwanted folders under jack . So When I open git-bash, the directory is under jack . And when I open git-gui, there are thousands of unrelated files in the sidebar which I can't do anything to change it. So I want to create a folder called code as the root directory of git. Is there any way to achieve it without uninstalling git?(btw, I'm using windows)

You can simply delete the c:/users/jack/.git folder and inside your code folder, initialize git using git init command

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM