I've been deleting the .git folder every time I want to stop tracking a git project and right now I'm curious as to which changes stay when I delete the .git folder. Let's say I clone a repository. It comes with master branch by default. I now change into a branch called develop. The master branch has some changes not in the develop branch. If I then delete the .git folder while I'm in the develop branch, what changes stay? Is it the changes in the default repository(master) or branch I was in before deleting the folder?
Asked
Active
Viewed 457 times
0
-
In addition to `.git/` there are also git-related files scattered over working directory, most notable `.gitignore` and `.gitattributes`. If you don't plan to create a new git repository with this working directory you probably would want to remote these files too. – phd Mar 11 '19 at 12:27
1 Answers
4
When you remove the .git
folder, all that remains is your "working [copy/tree/directory]". This is the currently checked out branch, plus the changes you made to the files in there.
See also:

CodeCaster
- 147,647
- 23
- 218
- 272