In the beginning, I did not add the. Classpath in the GIT project to the. Gitignore, causing the file to persist in the remote branch so that when executing git pull on another machine, the local. Classpath is corrupted and the reference to the project is problematic. Thus, we need to remove the. classpath file from the remote branch. 1. One idea is to add the. classpath file to the Gitignore so that the. classpath file is not committed at the next commit, but this practice does not cause the. classpath file in the remote branch to be deleted. 2. The following method to solve the problem: in the local project to move the classpath out of the Git repository in a location, equivalent to the Git repository to delete the classpath file;
MV Cps/.classpath.
Modify the Gitignore file, add *.classpath, commit to delete the Classpath version, found that the remote branch of the file has been deleted.
1 git add--all. 2 " Update Gitignore " 3 git push Origin master
Move the removed. classpath file back into the project, and if you commit again, because Classpath has been added to Gitignore, the Classpath file will not be resubmitted.
MV .. /.classpath cps/
git deletes files from the remote branch