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?
我想大声告诉你2017-05-02 09:24:57
Suppose you have a.txt
, b.txt
, c.txt
three files and they have all been submitted.
Now you wishignore
b.txt
That should be doneb.txt
加入到.gitignore
文件中,echo "b.txt" >> .gitignore
Then this time commit/push
, you will see
.gitignore
b.txt
If
b.txt
there are changes this time, you will see it. It’s okay
Just carecommit/push
,下次才会忽略所有b.txt
and you will ignore all
I don’t know if you need to say this🎜
ringa_lee2017-05-02 09:24:57
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 =.=)