Github README.md and readme.md - how to delete one?

a 夏天 提交于 2019-12-23 18:06:19

问题


Somehow I endup with having README.md and readme.md on github. Now these two influence each other so my GitHub.app gets completely confused. Github web site do not have any file delete function.

How to delete one of these files?


回答1:


The reason that github doesn't have a delete link or button is because a simple 'delete' goes against the nature of a Source Control Version System. The way to remove a file is to remove it locally, usually with a terminal window and the command line with git rm, commit that change - always with a message - and then 'push' that delete to the repository. If the file is present locally but never git added to git you can just rm filename the file - but warning, there's no 'confirm' normally at the command line with rm !
Admittedly, github could have looked to 'package' that all up into a delete page link that, given a text description for reason, could do that but it would be too much 'black magic' and misleading to users learning git and how to use github.

If you want a gui option, there are a lots of git gui tools out there. As you are on a mac, gitx , git-tower and source-tree are all tools that may help. There is also the basic mac-github tool at
http://mac.github.com/

The command line route is shown in the answer by ThiefMaster

More info on the overall git process and what the various commands and concepts are can also be found at: git branch, fork, fetch, merge, rebase and clone, what are the differences?




回答2:


Simply delete one of the files and commit the deletion.

$ git rm readme.md
$ git commit
$ git push


来源:https://stackoverflow.com/questions/12130498/github-readme-md-and-readme-md-how-to-delete-one

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!