Skip to content

Instantly share code, notes, and snippets.

@nnagornyy
Forked from cheshirrrcat/remove-from-git-index
Created April 21, 2018 17:51
Show Gist options
  • Save nnagornyy/ed0c0732be83235c0f4d4553a3eca05c to your computer and use it in GitHub Desktop.
Save nnagornyy/ed0c0732be83235c0f4d4553a3eca05c to your computer and use it in GitHub Desktop.
Удалить файл из индекса git-репозитория без его физического удаления
Для удаления файла из git-репозитория без его физического удаления:
git rm --cached mylogfile.log
Для удаления папки (рекурсивно) можно сделать так:
git rm -r --cached folderName
А для того, чтобы ситуация не повторялась, лучше добавьте файл или папку в .gitignore.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment