Use git to synchronize the code to the server, switch from the feature branch to master
or other new branches, and then execute git status
. The prompt contains untracked files
, and these untracked files
have been deleted.
[www@iZ94 fl.com]$ git status
# On branch develop
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# images/an_page_h5-06.png~HEAD
# images/an_page_h5-06.png~HEAD_0
# images/an_page_h5-07.png~HEAD
# images/an_page_h5-07.png~HEAD_0
# images/an_page_h5-08.png~HEAD
# images/an_page_h5-08.png~HEAD_0
# images/an_page_h5-09.png~HEAD
# images/an_page_h5-09.png~HEAD_0
nothing added to commit but untracked files present (use "git add" to track)
[www@iZ94 fl.com]$
[www@iZ94 fl.com]$ git reset --hard origin master
fatal: Cannot do hard reset with paths.
[www@iZ94 fl.com]$ git reset --hard remotes/origin/develop
HEAD is now at 6ac5b22 Merge branch 'PD_MC-414_Ma1-2' into 'develop'
These image files are not needed. The local computer is WIN, which is not case-sensitive and the capitalization is wrong. Submitted to LINUX, it was case-sensitive. It was later changed, but the cache could not be deleted. Now when switching to other branches, there will be such a prompt. Use git reset --hard remotes/origin/master
to figure out how to force it to become a clean branch.
Git reset is to restore the contents of the temporary storage area. This content is not in the temporary storage area. You can use git clean to clean it, or delete these files directly, or use git checkout to restore the contents of the workspace!
Visually check that these files are generated during the running of your program. You can delete them directly. The best solution is to place the generated temporary content in some specific directories, and then add this directory to the
.gitignore
file