理解gitk指南? [英] Guide to understanding gitk?

查看:95
本文介绍了理解gitk指南?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在向一个开发团队介绍git,我发现gitk是一个了不起的工具。这也很难理解,因为理解gitk需要理解git历史和查看器工具本身。



有没有人可以很好地引用类似gitk git历史的初学者指南?

解决方案

我从未见过任何专门针对gitk的东西。从如何运作的角度来看,这是一个刺戳。知道一切背后的命令(或者至少在一般情况下是相同的)有助于学习更轻松地使用命令行工具,并且还显示了在哪里查看文档以更好地理解gitk!



文件菜单



这在过去的几个主要版本中有所变化 - 我正在描述当前状态。




  • 更新和重新加载:这可能是最令人困惑的事情。重新加载会刷新所有内容,就像您使用相同的配置启动程序一样。这意味着如果某个分支已被移除/重新分配,如果某些提交现在悬而未决,则不会再看到它们。另一方面,更新刷新所有信息,但仍显示先前显示的所有提交。这是一个很好的事情,如果你正在重新设计,并希望确保你没有搞砸 - 你可以看到原来的和重新发布的版本。


  • <引用:非常明显。参考文献包括标签和分支(可能是远程的)。您可以重新阅读它们,并列出来点击特定的一个以显示在历史记录中。
  • >

    正如男人页面说,gitk需要 git- rev-list 选项来帮助指定应显示的历史记录。这些也可以在查看菜单中交互设置。手册页是查找有关可以控制视图的方式的更多信息的绝佳位置(主要在提交限制部分)。如果您之前已经看过 git-log ,您会看到很多这样的内容。

    帮助



    这里有一个键盘列表! Sweet。

    上下文菜单



    这提供了几个常见的git瓷器命令,通常处于通用/默认模式操作。列出它们至少可以帮助你找到正确的文档来理解他们做了什么,如果你还没有的话!


    • git-diff (区分这个< - > li>
    • git- format-patch (make patch)

    • git-tag (创建标签)
    • git-diff-tree (写入提交到文件,很少使用)
    • < git-branch
    • $ b $ href =http://www.kernel.org/pub/software/scm/git/docs/git-branch.html =noreferrer> b
    • git-cherry-pick a>

    • git-reset (重设分支到这里)这会提示你软,混合或硬简要提醒每个人做些什么。在手册页上有更长的描述,但当然你必须理解索引的概念才能真正得到它。 一个提交和相关的命令在这一点上应该是不言自明的。



      在分支的上下文菜单中,我们有 git-checkout -d (删除)模式的git分支。



      中间部分




      • < SHA1 ID:当前提交的散列。非常有用的复制/粘贴到终端执行您使用gitk查找给定提交的操作。
      • 前进/后退按钮,行号...显而易见!


      • 查找!这里的选项又是不言而喻的,但对于每个人的教育,它们都类似于 git-log 参数:contains是 - grep ,接触路径是参数,添加/删除字符串是 -S (镐子)。




      留言/差异窗格



      在这里,我们有提交消息以及git-diff的输出 - 这就像使用 git-log -p ,稍加一点:


      • 分支相当于 git branch -a - -contains =< commit>


      • Precedes/Follows相当于 [--contains]< commit> git-describe



      I am introducing git to a team of developers and i find gitk to be an amazing tool. It's also quite hard to understand, since understanding gitk requires an understanding of both git history and the viewer tool itself.

      Does anyone have any good references to something like a "beginner's guide to git history with gitk" ?

      解决方案

      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!

      • git-diff (Diff this <-> selected
      • git-format-patch (make patch)
      • git-tag (create tag)
      • git-diff-tree (write commit to file, rarely used)
      • git-branch
      • git-cherry-pick
      • git-reset (reset branch to here) This prompts you for soft, mixed, or hard, with a brief reminder of what each does. Longer description on the man page, but of course you have to understand the concept of the index to really get it.

      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指南?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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