1

I've edited my gitignore to ignore some files (like .gradle, .idea) but how can i delete this files from github? https://github.com/hakkikaancaliskan/NetHesap.git

Kaan
  • 73
  • 1
  • 9
  • 1
    Delete the file, push the commit, then add to .gitignore. If you want to remove it from history completely, easier to just start over sometimes. – Mad Physicist Jun 26 '18 at 19:06
  • 2
    [Remove a file from a Git repository without deleting it from the local filesystem](https://stackoverflow.com/q/1143796/7976758). [How to remove/delete a file from commit history](https://stackoverflow.com/q/2100907/7976758). – phd Jun 26 '18 at 19:11

1 Answers1

1

I suggest you make it in a different order:

  1. Delete files from disk physically
  2. Add deleted files into index: git add . -A
  3. git commit -m'files deleted'
  4. Edit .gitignore now
pyotruk
  • 81
  • 1
  • 3