Files pushed by Git are set to be ignored and not deleted from the repository
ringa_lee
ringa_lee 2017-05-02 09:45:29
0
7
845

The configuration file is pushed to the remote warehouse for the first time. Since the system environment of each member of the project is different, the configuration content is also different. It needs to be ignored to prevent pushing

Now cancel the tracking through git rm --cached filename, and then write the file to .gitignore to ignore it. It can indeed be ignored, but the change displayed when submitting is 忽略的文件被删除, and the ignored file is indeed ignored after being pushed to the remote warehouse. Deleted

In general, I want to push the file up for the first time and not push it in the future, but I didn’t expect that if I ignore it, it will be deleted directly from the warehouse. Can you please give me some advice on how to achieve this?

ringa_lee
ringa_lee

ringa_lee

reply all(7)
Peter_Zhu

Using sparse checkoutsparse-checkoutSolved the problem
Attached reference link link description

Ty80

You can try to deceive yourself and pretend you can’t see it. .

git update-index --assume-unchanged xxx/xxx
PHPzhong

In this case, you usually create one config.ini.distfor users to modify

伊谢尔伦

I think you don’t actually need to set ignore files in the .gitignore file. Since you don't want to push those files to the remote, but want to keep those files remotely, you can just not add them to the temporary storage area. Specifically, just git add的时候,别把那些文件addjust go in. However, this also has the disadvantage that you may encounter a situation where you cannot switch branches because there are always some modifications that have not been added to the staging area.

滿天的星座

Your idea is very strange. Since you don’t need to worry about it after the first submission, then you don’t need to add it to the .gitignore file. Is your file constantly changing?

世界只因有你

Just add the file name directly to gitignore, and then generate one online and you’re done. Why do you have to fix git? Didn't understand.

黄舟

I have encountered this problem and haven’t found a solution yet. I guess there’s no way

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template