search

Home  >  Q&A  >  body text

git - The rm command cannot be used under win

You can use the git command, but why can’t you use the rm command?

怪我咯怪我咯2797 days ago1158

reply all(4)I'll reply

  • 伊谢尔伦

    伊谢尔伦2017-05-02 09:46:32

    It seems that you are using git cmd, and git cmd does not have rm命令,你可以使用cmd中的删除命令,如delrd等。如果要使用rm命令,建议使用git bash。
    另外,有一点我需要说明的是,如果要删除已跟踪的文件,即从暂存区移除,最好使用git rm file. In this case, the deleted files will not appear in the untracked file list in the future.

    reply
    0
  • 世界只因有你

    世界只因有你2017-05-02 09:46:32

    cmd is not there

    You can consider using git bash which has this command

    reply
    0
  • 给我你的怀抱

    给我你的怀抱2017-05-02 09:46:32

    Please read git’s prompt content carefully:

    use "git rm --cached <file>..." to unstages

    The command should be:git rm myFile

    You can also git help to view more commands; or directly git help查看更多的命令;或者直接git即可.
    一般在win下面使用git, 需要区分git命令linux命令.
    Generally used under win

    , you need to distinguish between git command and linux command.🎜

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-05-02 09:46:32

    Use powershell and come with rm (Remove-Item)

    reply
    0
  • Cancelreply