We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 9 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(4)
我从来没有见过任何专门针对 gitk 的东西。从“它是如何工作的”的角度来看,这是一个尝试。了解所有内容背后的命令(或至少大致等效)有助于学习更轻松地使用命令行工具,并且还向您展示在文档中查找的位置以更好地理解 gitk!
文件菜单
这在过去的几个主要版本中有所改变 - 我正在描述当前状态。
更新和重新加载:这可能是最令人困惑的事情。重新加载会刷新所有内容,就像您使用相同的配置重新启动程序一样。这意味着如果一个分支已被删除/重新设置基础,如果某些提交现在悬空,您将不再看到它们。另一方面,更新会刷新所有信息,但仍显示之前显示的所有提交。如果您正在进行变基并希望确保没有搞砸,那么这是一个很好的工具 - 您可以看到原始版本和变基版本。
参考文献:非常明显。引用包括标签和分支(可能是远程的)。您可以重读它们,然后列出并单击特定的一个以将其显示在历史记录中。
正如
手册页 所说,gitk 需要 git-rev-list 帮助指定的选项应该展示什么历史。这些也可以在“视图”菜单中交互设置。手册页是查找有关控制视图的方法的更多信息的绝佳位置(主要位于提交限制部分)。如果您之前看过 git-log,您会看到很多这样的内容。
帮助
这里有一个键绑定列表!甜的。
上下文菜单
这呈现了几个常见的 git Ceramic 命令,通常处于常见/默认操作模式下。列出它们至少可以帮助您找到正确的文档来了解它们的用途(如果您还没有)!
此时,“标记提交”和相关命令应该是不言自明的。
在分支的上下文菜单中,我们有 git-checkout 和 git-branch 的
-d
(删除)模式。中间部分
SHA1 ID:当前提交的哈希值。对于复制/粘贴到终端以对您使用 gitk 查找的给定提交执行操作非常有用。您还可以将哈希值粘贴到此处。
前进/后退按钮,行号...明显!
找到!这里的选项同样是不言自明的,但对于每个人的教育来说,它们类似于 git-log 参数:“containing”为
--grep
,“touching paths”为参数,添加/删除字符串为-S
(镐)。消息/差异窗格
这里我们有提交消息以及 git-diff 的输出 - 这类似于使用 git-log -p ,但有一些额外的内容:
“Branches”相当于 < code>gitbranch -a --contains=
“Precedes”/“Follows”相当于
git describe [--contains]
(git-describe)I've never seen anything specifically for gitk. Here's a stab at it, from a "how does it work" point of view. Knowing the commands that are behind everything (or at least generally equivalent) helps learn to use command-line tools more easily, and also shows you where to look in documentation to understand gitk better!
File menu
This has changed somewhat over the last few major versions - I'm describing the current state.
update and reload: This is probably the most confusing thing. Reload refreshes everything as if you started the program over with the same configuration. This means if a branch has been removed/rebased, if some commits are now dangling, you don't see them anymore. Update, on the other hand, refreshes all the information, but still shows all commits that were previously shown. This is an excellent thing to use if you're rebasing and want to make sure you didn't mess up - you can see both the original and rebased versions.
references: pretty obvious. References include tags and branches (which may be remote). You can reread them, and list to click a particular one to show it in the history.
Views
As the man page says, gitk takes git-rev-list options to help specify what history should be shown. These can also be set interactively in the "view" menu. The man page is an excellent place to find more information about the ways you can control views (it's mostly in the commit limiting section). If you've looked at
git-log
before, you'll have seen a lot of this.Help
There's a list of keybindings here! Sweet.
Context menu
This presents several common git porcelain commands, generally in a common/default mode of operation. Listing them will at least help you find the right documentation to understand what they do, if you don't already!
The "mark a commit" and related commands should be self-explanatory at this point.
In the context menu for a branch, we have git-checkout and the
-d
(delete) mode of git-branch.Middle section
SHA1 ID: the hash of the current commit. Very useful for copy/paste into a terminal to perform an action on a given commit you used gitk to find. You can also paste hashes into here.
Forward/back buttons, row number... obvious!
Find! The options here are again pretty self-explanatory, but for everyone's education, they're analogous to git-log parameters: "containing" is
--grep
, "touching paths" is the arguments, and adding/removing string is-S
(pickaxe).Message/diff pane
Here we have the commit message along with git-diff's output - this is something like using
git-log -p
, with a little extra:"Branches" is equivalent to
git branch -a --contains=<commit>
"Precedes"/"Follows" is equivalent to
git describe [--contains] <commit>
(git-describe)这里用截图介绍一下gitk中分支历史的可视化。
http://lostechies.com/joshuaflanagan/2010/ 09/03/使用-gitk-理解-git/
Here is an introduction to the visualization of branch history in gitk with screenshots.
http://lostechies.com/joshuaflanagan/2010/09/03/use-gitk-to-understand-git/
新手真正能用“gitk和历史的结合”来说的是如何通过查看gitk树视图来识别发生了什么的具体解释。
据我所知 - 查看树的正确方法是(当然):
屏幕截图也将受到赞赏。
该树实际上代表了存储库的当前状态。如果我们能够通过查看树视图来判断发生了什么,那就太好了。
谢谢
v。
What novices could really use in terms of "combination of gitk and history" is a specific explanation how to recognize what happened by looking at the gitk tree view.
As far as I got - the right way to look at the tree is (of course):
Screenshots would be appreciated as well.
The tree is actually representing the current state of the repository. What would be great is if we would be able to tell what happened by looking at the tree view.
Thanks
v.
我发现 gitk 界面唯一有用的是漂亮的(丰富多彩的)分支概述。
如果你想要 git 的 gui,请检查 Windows 上的 TortoiseGit 或 Mac 上的 GitX 或 Linux 上的 QGit。
The only thing I find useful about the gitk interface is the nice (colorful) branches overview..
If you want a gui for git, check TortoiseGit on windows or GitX on Mac or QGit on linux.