How can I delete a file from a Git repository?

后端 未结 24 2336
無奈伤痛
無奈伤痛 2020-11-22 13:41

I have added a file named \"file1.txt\" to a Git repository. After that, I committed it, added a couple of directories called dir1 and dir2

24条回答
  •  长情又很酷
    2020-11-22 14:09

    More generally, git help will help with at least simple questions like this:

    zhasper@berens:/media/Kindle/documents$ git help
    usage: git [--version] [--exec-path[=GIT_EXEC_PATH]] [--html-path] [-p|--paginate|--no-pager] [--bare] [--git-dir=GIT_DIR] [--work-tree=GIT_WORK_TREE] [--help] COMMAND [ARGS]
    
    The most commonly used git commands are:
       add        Add file contents to the index
       :
       rm         Remove files from the working tree and from the index
    

提交回复
热议问题