You know, these .git s don't look fine in a PC when you work.So I have decided to delete it. But I'm afraid if it deletes my files/folders cloned/pulled from github under this repository.
Deleting the .git folder does not delete the other files in that folder which is part of the git repository.
However, the folder will no longer be under versioning control.
Since having a .git
folder in tour sources is an issue when working on your files, you can clone your GitHub repo while setting the .git
folder elsewhere (similar to " Can I store the .git
folder outside the files I want tracked? "):
cd C:\path\to\parent\folder
git --git-dir=C:\path\to\myrepo.git --work-tree=myrepo clone https://<myaccount@githuub.com/<myaccount>/myrepo.git
echo "gitdir: C:/path/to/myrepo.git" > myrepo\.git
cd myrepo
# start adding, committing, pushing
Of course, replace <myaccount>
and " myrepo
" with your GitHub account and your GitHub repo name.
But the idea is:
.git
repo C:\\path\\to\\myrepo.git
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.