1

I use git and gitk a lot. Recently, I found some enthousiastic posts about tig and decided to give it a try. It looks great for viewing the repository, however changing the repo with tig seems difficult if not unworkable.

The problem I am facing is that tig fails to start an editor for external commands, thus making it impossible to continue with the action. For example, if I select a commit and issue

!git commit --amend

I get a screen saying

vim: Warning: Output is not to a terminal 

Only ^C gets me out, thus stopping tig as well.

What can I do to configure this properly for either tig or git in order to get this working?

thanks in advance, Ruud

4

1 回答 1

1

启动外部命令的主要方式是通过键绑定,在 Tig 中称为用户定义的命令。例如,要修改最后一次提交,您可以添加以下内容,~/.tigrc然后按下+将直接进入 Vim:

bind generic + !git commit --amend

浏览状态有几个变量,可以传递给外部命令,例如%(commit)%(branch)以及%(prompt)请求输入,例如在创建分支时。

作为参考,例如,!<command>允许在寻呼机中打开输出,!git show 3e3abcd因此更像是 Vim 的:r!<command>.

于 2016-09-18T00:40:44.600 回答