There are some configuration files on the remote warehouse that have been uploaded before. I want to remove their version control. Do not add these configuration files every time you commit or push. So first set these files to untrack, then create a .gitignore file, and add the file name to be ignored. The icon of the file in eclipse has changed. When committing, various delete: file names are prompted.
But regardless of whether it is commit or commit/push, all the files that were ignored just now have been added to version control (you can see it through the icon of the file in eclipse, you can also see it after modifying the file content and committing). I would like to ask what is going on? Why are the files that were originally removed from version control added to version control after the commit?
Suppose you have
a.txt
,b.txt
,c.txt
three files and they have all been submitted.Now you wish
ignore
b.txt
That should be done
b.txt
加入到.gitignore
文件中,echo "b.txt" >> .gitignore
Then this time
commit/push
, you will seeJust care
changes next time.commit/push
,下次才会忽略所有b.txt
and you will ignore allThis contains the results you want /q/1010000000430426
The problem has been solved. The operation method is (in eclipse): first right-click the file to be removed from version control and ignore it. A record of the file will be added in .gitignore, then delete the file, then commit and push, so that the remote branch will be deleted. The file. Next time you regenerate the file locally, since it is added to .gitignore, the newly generated file will no longer be added to version control~
(ps: I have followed this idea before without success. , but the next day, I asked others for advice and they also said to do it this way, and then I went home and did it again and it was successful =.=)