问题
This is on Ubuntu 14.04, git
version 1.9.1 (same for gitk
). I'm doing this:
$ cd /tmp
$ git clone https://github.com/underdoeg/ofxLibRocket.git ofxLibRocket-git
Cloning into 'ofxLibRocket-git'...
remote: Counting objects: 1013, done.
remote: Total 1013 (delta 0), reused 0 (delta 0), pack-reused 1013
Receiving objects: 100% (1013/1013), 16.85 MiB | 326.00 KiB/s, done.
Resolving deltas: 100% (631/631), done.
Checking connectivity... done.
$ cd ofxLibRocket-git
$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean
$ git log -1 --decorate
commit 14360ed8fd3428aa0a2e052f6363e5daa0bf0d75 (HEAD, origin/master, origin/HEAD, master)
Merge: 06dd209 801877c
Author: Philip Whitfield <philip@undef.ch>
Date: Fri Feb 22 03:16:37 2013 -0800
Merge pull request #6 from neilmendoza/master
Fixed OSX libs and example
$ gitk --all .
So far so good - but, if I run gitk --all .
in this directory, then the commit of current HEAD is not indicated in the gitk
display? This is what I get:
This is the weird thing: the only commit containing the word OSX
shown in gitk
, which I've selected manually:
- has the hash
801877c48390324dc7d600936306cd7c00486dcc
, unlike whatgit log
shows for current head,14360ed8fd3428aa0a2e052f6363e5daa0bf0d75
- The
14360ed8
is the "merge pull request" by one committer, the801877c
the pull request by another committer, for the same patch/commit, "Fixed OSX libs and example" - The
14360ed8
is not listed in any commit ofgitk
- There is no yellow dot to indicate HEAD, nor a "master" branch label, anywhere in
gitk
(and certainly not next to801877c
).
So, why doesn't gitk
in this case show the HEAD and the 14360ed8
commit? I have tried doing:
git checkout master
git reset --hard HEAD
... but it seems to make no difference in terms of display in gitk
... How can I get the proper display of HEAD and the master branch in this case?
EDIT: So, I installed gitg
(Version 0.2.7), and it seems to make more sense visualisation-wise:
So is this a bug in gitk
, or does gitk
need some special setup (say, command line switches) to show this state of the repository?
回答1:
gitk --all
without path specification gives the expected result, exactly asgitg
- It seems that
gitk <some path>
completely ignores--all
switch and displays the first commit which modifies a given file and doesn't collect any references. So again I wouldn't call it a bug, just a, hmm, way it's implemented. Also I should mention that specifying a file in the command line forgitk
is a unusual thing for me.
来源:https://stackoverflow.com/questions/33619341/gitk-does-not-show-head-of-master