在Git中重置所有暂存文件的最简单方法是什么? [英] What is the simplest way to reset all staged files in Git?

查看:54
本文介绍了在Git中重置所有暂存文件的最简单方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我以前在单个文件中使用过 git reset ,但是我经常发现自己必须在提交之前取消登台多个文件.是否存在取消所有已暂存文件的命令?我在文档中找不到它( http://git-scm.com/docs/git-重置).

I have used git reset before for single files but I frequently find myself having to unstage multiple files before a commit. Is there a command that unstages all staged files? I couldn't find it on the documentation (http://git-scm.com/docs/git-reset).

推荐答案

git status 通常会向您显示选项,例如

git status normally shows you the options, e.g.

On branch master
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)

    modified:   someFile.txt
    modified:   someDir/someOtherFile.txt

因此,如果要取消暂存所有文件,请按照git的建议进行操作

So if you want to unstage all files just do what git proposes

git reset HEAD

这篇关于在Git中重置所有暂存文件的最简单方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆