如何在Git Gui中放弃文件的更改? [英] How do I discard changes for a file in Git Gui?

查看:1066
本文介绍了如何在Git Gui中放弃文件的更改?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



有没有一种方法可以在Git Gui中轻松完成此操作?如果没有,是否有什么特别的原因,这个功能在Git Gui中不可用?

解决方案

我知道这种方式: p>


  1. 所做的更改必须保持不变

  2. 转至工具 - > <强>添加 ...

  3. 为您的命令选择任何您喜欢的名称,然后在命令中写入 git checkout $ REVISION - $ FILENAME

  4. 选择(左键单击)您要结帐的文件 工具您刚创建的命令

所选文件将被签出到 HEAD 修订


Often when using Git Gui I would like to reset/checkout a single file or just dismiss a hunk.

Is there a way to do this easily in Git Gui? If not, is there any particular reason that this feature is not available in Git Gui?

解决方案

I know this way:

  1. the changes must be unchanged
  2. go to Tools -> Add...
  3. choose whatever name you like for your command, then in Command write git checkout $REVISION -- $FILENAME
  4. select (left-click) the file you want to checkout
  5. choose from Tools the command you just created

The chosen file will be checked out to HEAD revision

这篇关于如何在Git Gui中放弃文件的更改?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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