简体   繁体   中英

git remove file from upstream (github) repository

I inadvertently pushed an .htaccess file from my local to my upstream (github.com) repo. I do not want my team to have this .htaccess file as it will break their local environment. Is there a method to delete this file from the upstream repo? After I realized the file was pushed I go into my local and

 git update-index --assume-unchanged magento/.htaccess

however I cannot delete the file from my local, that would break my local environment.

Hope this helps you:

  1. Move the file temporarily (so with a git status it appears deleted).
  2. Add the file to your .gitignore .
  3. git commit the file deletion and the updated .gitignore and push the changes to your remote repository.
  4. Re-add the file to your local repository.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM