I uploaded to the remote repository (github) a file with the codes application.yml. How can I remove it from there and stop tracking changes on it?

2 answers 2

  1. Add file to .gitignore
  2. git rm --cached --ignore-unmatch application.yml - delete the file only from the repository, and the file is physically stored on disk
  3. git commit -am "Message"
  4. git push origin {branch name}
  • Executed the second command. The file was deleted altogether, I need to delete from the repository, and leave it on the disk. - ks_on_v
  • It should not delete the file from the disk, but I added the answer - zhenyab

Delete and commit and push. And yes, not to delete, but in .gitignore it

  • 3
    First delete, and then in .gitignore. Otherwise it will not help. - Pavel Mayorov