Delete the file remote git repository

  • git rm -r -n --cached 文件/文件夹名称 
    
    加上 -n 这个参数,执行命令时,是不会删除任何文件,而是展示此命令要删除的文件列表预览。
    
  • Determine the correct delete files

    git rm -r --cached 文件/文件夹名称
    
  • Submit to local and pushed to the remote server

    git commit -m "提交说明"
    git push origin master
    
  • Modify local files and submit .gitignore

      git commit -m "提交说明"
      git push origin master

 

Published 29 original articles · won praise 5 · Views 7993

Guess you like

Origin blog.csdn.net/qq_25194685/article/details/98209378