git中新建文件的最快方式是什么?

栏目: 编程工具 · 发布时间: 6年前

内容简介:代码日志版权声明:翻译自:http://stackoverflow.com/questions/6827815/what-is-the-fastest-way-to-unstage-parts-of-a-new-file-in-git
当我想将一个新文件分成几个提交时,我可以添加-N<

file>然后使用git gui交互式地播放线.当我在分期时犯错误的时候,git gui不会让我独立行,因为它是一个新的文件(这似乎是一个bug).当然,我可以随时重写整个文件,重新开始,但是我想知道是否有更有效的方法.

我使用的是git 1.7.5.

要澄清,这个问题是特定于新的aka未追溯的文件!

从命令行类型:

git reset -p

这将使您可以使用标准的命令行界面来管理hunks,从索引中选择untage hunk.这与git add -p相反.

UPDATE

好的,当文件是新的时,看起来你不能选择性地分段不同的hunks.鉴于git-gui和标准git hunk编辑器都不允许这样做,这可能是不可能的.

代码日志版权声明:

翻译自:http://stackoverflow.com/questions/6827815/what-is-the-fastest-way-to-unstage-parts-of-a-new-file-in-git


以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Data Structures and Algorithms with JavaScript

Data Structures and Algorithms with JavaScript

Michael McMillan / O'Reilly Media / 2014-2-22 / USD 28.51

If you’re using JavaScript on the server-side, you need to implement classic data structures that conventional object-oriented programs (such as C# and Java) provide. This practical book shows you how......一起来看看 《Data Structures and Algorithms with JavaScript》 这本书的介绍吧!

MD5 加密
MD5 加密

MD5 加密工具

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具