The old project was transferred to the new git server. When cloning from a git server to a client machine with tortoise Git, old files are displayed by cracks, and new ones are normally stored in Russian. Old files re-created and saved. New files were normally pushed (push) to the server, but old files with files are also shown in the history.

  • Tried to specify skip worktree in the commit, gives the error "libgit2 returned: Index does not contain" the name of the file with the razors "".
  • I tried to delete and commit, but during commit the status of the file says "missing" and commit does not occur with the error "no changes added to commit". Those. now you need to remove these files from the history in some way.
  • I tried to add to ignore list but it is not added, I assume that I can not parse the name of the file.

Addition: git 2.7.4 server is installed on linux ubuntu 16.04 TLS, locale lang = en_US.UTF-8, LANGUAGE = en. On the client side of windows 7, tortoise git 2.2.0.0, git version 2.8.1.windows.1. language and regional standards specified Russian (Russia)

  • It looks like different locale settings on the old and new server. - AK
  • one
    @AK, because the git program runs locally, then, most likely, different settings just on local machines, and not on the server. - aleksandr barakin
  • try git rm on cracked files - ixSci

1 answer 1

To rename files with their change history, you can use the git mv command:

 $ git mv файл.с.неправильным.названием файл.с.правильным.названием 

The status command will then show the changes made (so far) to the index:

 $ git status On branch master Changes to be committed: (use "git reset HEAD <file>..." to unstage) renamed: файл.с.неправильным.названием -> файл.с.правильным.названием 

these changes should be committed with the commit command, and, if necessary, sent to the server with the push command:

 $ git commit $ git push 

and if you just need to delete the file from the repository, you can use the rm command:

 $ git rm файл 

after which this change should be committed and, if necessary, sent to the server.


if you want to delete and mention the file in the history, you can use the answer to this question: How to remove the file from the history of Git? (but when changing the history of a shared repository, this action, in my opinion, is unproductive).

  • he ALREADY renamed the files, he needs to delete the old ones - ixSci
  • @ixSci, well, I was focused on solving the original problem. but added about rm . - aleksandr barakin