Skip to content

Instantly share code, notes, and snippets.

@reactcoder-it
Forked from cheshirrrcat/remove-from-git-index
Created September 12, 2018 01:05
Show Gist options
  • Save reactcoder-it/a6d0d89878fa5cababe434b792afd42d to your computer and use it in GitHub Desktop.
Save reactcoder-it/a6d0d89878fa5cababe434b792afd42d 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