更好的git add -p? [英] Better git add -p?
问题描述
有时我在没有安装X Window的系统上工作,无法使用Git GUI。
现有控制台替代 git添加-p
?
我喜欢它所做的几乎所有事情(不仅仅是Git GUI),但我讨厌它不允许我查看整个图片并选择我想查看块的顺序。这是Git GUI在
我试过 tig
,但我不喜欢它提供的用户体验。
有什么建议吗? p>
Vim有一个插件'fugitive'
/ strong>:关联的vimcast(评论)非常好,我推荐它。我想补充一点,通常不需要在longhand中输入 这个功能的最佳命令似乎是 Vim是一个终端编辑器(它也碰巧有一个gui端口) 逃亡者插件只会让你编辑索引和worktree版本的文件,让你分散/ diffabtain,直到你满意。 Vim的diff模式比较复杂,比 您可以在这里得到逃亡者 从 编辑工作树中的文件并进行一些更改。使用|:Gdiff |打开 Sometimes I work on system without X Window installed, and can't use Git GUI. What are existing console alternatives to the I like almost everything that it does (more than Git GUI actually), but I hate that it does not let me view the whole picture and choose the order that I want to review the chunks. That's the only actual advantage of Git GUI over I tried Any suggestions? Vim has a plugin 'fugitive' Edit: the linked vimcast (comments) is excellent and I recommend it. I would like to add the hint that there will normally not be a need to type The best command to start with for this feature appears to be Vim is a terminal editor (which so happens to have a gui port too) The fugitive plugin will simply let you edit the index and worktree versions of files alongside each other and let you diffput/diffobtain until you're satisfied. Vim's diff mode is sophisticated, and much more flexible/intuitive than You can get fugitive here Snippet from Edit a file in the work tree and make some changes. Use |:Gdiff| to open up
the indexed version. Use |do| and |dp| on various hunks to bring the files in
sync, or use |:Gread| to pull in all changes. Write the indexed version to
stage the file.
这篇关于更好的git add -p?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!:diffget
和:diffput
,因为你可以在正常/可视模式下通过按 d o 和 d p / p>
:Gstatus
git add --patch
。更灵活/直观。
的片段:他逃亡
:
索引版本。使用| do |和| dp |在各种各样的克隆带来
同步的文件,或者使用|:Gread |吸纳所有变化。将索引版本写入
阶段。
git add -p
?git add -p
to me, but it is rather crucial one.tig
, but I do not like the user experience that it offers.:diffget
and :diffput
in longhand, because you can do he same directly in normal/visual mode by pression do and dp.:Gstatus
git add --patch
.
:he fugitive
: