简体   繁体   中英

How to delete a file in Github with git command line?

I have a file 3 Mb large in Github, online only. I want to delete or move it, but Github won't let me do anything with it. It says 'This file has been truncated, but you can view the full file.' That is all. What can I do to move/delete it?

有时您只需要一个git status命令。

First, run git clone <github url> . Then change directories into that folder cd <folder name> . Run git rm <filename> to remove the file from the repository. If you want to move it, run mv <filename> <folder to be moved to> . After deleting run git commit -m "<commit comment>" . If you moved the file, run git add <newfilename> and then git commit -m "<commit comment>" . The commit comment should describe the changes you made (such as deleting the file). Then run git push , which will push your changes to Github.

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