2

I accidentally added and committed a file from my local repo that I do not want added to my GitHub project's repo. Can I delete this file with terminal or can I manually delete it online?

andy4thehuynh
  • 2,042
  • 3
  • 27
  • 37
  • 2
    Possible duplicate of [How can I remove a commit on github?](http://stackoverflow.com/questions/448919/how-can-i-remove-a-commit-on-github). Take a look at [this answer](http://stackoverflow.com/a/449070/464744). – Blender Apr 05 '13 at 20:25
  • Duplicate of [How can I delete a file from git repo?](http://stackoverflow.com/q/2047465/456814). –  May 24 '14 at 23:12

1 Answers1

5

From command line you could do following:

git rm <file> - remove file locally and marks it for deletion
git commit -m"your message" - commit file to local repo
git push origin master - push the change to github.
anazimok
  • 1,750
  • 2
  • 20
  • 33