How is it right to remove Git tracking?
-
If you need to remove Git tracking (version) it's right to remove the folder.
.git/
?
-
In this reply:
- Which files and directories belong to Git
- How to remove the Git version
- Unix, Windows + git bash
- Windows, cmd.exe
- Windows, conductor
- How to get a new copy of the project without a version
1. Which files and directories belong to Git
Git keeps history and build in folders
.git
and files.git...
♪ There's only a folder..git
at the root of your project. If there's submodules in it, there's also a file..gitmodules
in the root and files.git
Somewhere in the folders.project/ - .git/ - .gitmodules - .gitignore - .gitattributes - пустая-папка/ - .gitkeep - ещё-папка/и-ещё/внутри/ - .git - .gitignore - тут-файлы-и-папки-субмодуля
2. How to remove the Git version
Unix-joint systems, Windows c git bash or cygwin:
Make sure you're at the root of the project!
cd path/to/project find . -name ".git*" | xargs rm -ri
With the key.
-i
This team will work on-line and request confirmation of the disposal of each file. https://ru.stackoverflow.com/questions/541242/%D0%95%D1%81%D0%BB%D0%B8-%D0%BD%D1%83%D0%B6%D0%BD%D0%BE-%D1%83%D0%B4%D0%B0%D0%BB%D0%B8%D1%82%D1%8C-git-tracking-%D0%B2%D0%B5%D1%80%D1%81%D0%B8%D0%BE%D0%BD%D0%B8%D1%80%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D0%B5-%D0%BF%D1%80%D0%B0%D0%B2%D0%B8%D0%BB%D1%8C%D0%BD%D0%BE-%D0%BB%D0%B8-%D0%BF%D1%80%D0%BE%D1%81%D1%82%D0%BE-%D1%83%D0%B4%D0%B0%D0%BB%D0%B8%D1%82%D1%8C-%D0%BF/541258?noredirect=1#comment685165_541258 for improving the original team.Windows, cmd.exe
(laughs) https://stackoverflow.com/a/36945328/2790048 )
cd path\to\project del /F /S /Q /A .git rmdir .git
Windows, through the wire
- Turn on the display of hidden files and files.
Open your project folder, find a search field:
Get in there.
filename:.git
, wait for the end of the search:Note that other types of search work worse:
name:.git
includes such filessource.git.cs
♪ext:.git
not including catalogue.git
Just.git
includes a slow and unnecessary search for the contents of the filesNow you can choose the git files and remove them. All Found files. It's not going to hurt you.
3. How to get a new copy of the project without a version
Maybe you just need a copy of the project that doesn't have a version. This is a good git-archive for:
git archive master --format zip --output path/to/archive.zip
The archive.zip received can be transferred and unpacked by receiving a new project without a version.
The submodules are not packed.