I don’t want Git to track disimportant this file. I can create a .gitignore file to untrack it, but is there any command that can achieve better results?
给我你的怀抱2017-05-17 10:04:56
git is not tracking this file. It's telling you this. If you don't want it to pay attention to this file, just add .gitignore.
If you plan to share the warehouse with others, but don’t want others to ignore this file or know the name of this file, you can write it in the .git/info/exclude file.
Extended reading: ProGit Second Edition Chinese Version.
我想大声告诉你2017-05-17 10:04:56
git update-index –assume-unchanged file_path
file_path absolute path
为情所困2017-05-17 10:04:56
The question described by the question is not very clear, so I will answer it based on various situations:
Do not track files that are not tracked by git
Just add the file to the .gitignore
file
Stop tracking files tracked by git, but keep the previous tracking status of the filegit rm --cached 文件名
Temporarily make git ignore tracked filesgit update-index --assume-unchanged 文件名
For a detailed explanation of this command, please see the high-voted answer of git ignores files that have been submitted
迷茫2017-05-17 10:04:56
You don’t want others to use this file. Why do you put it in the git directory?
If you want others to use it or this file is needed in the project, a better approach is to make a disimportant.example file, delete the disimportant file, and then indicate this in the project description