2017-07-28 2 views
1

私は空白と最後のコミットの日時を取得しようとしているコミット行き方:最後の日時が

git log -n 1 --pretty=format:%cd --date=format:%d %b %Y 

例外がある:

fatal: ambiguous argument '%b': unknown revision or path not in the working tree. 
Use '--' to separate paths from revisions, like this: 
'git <command> [<revision>...] -- [<file>...]' 
+0

演習:(a)「スポットランを見る」というフレーズにはいくつの単語がありますか? (これは些細なことですが、それは次の2つを準備することです)(b)フォーマット:%d%b%Yにはいくつの単語がありますか? (c) ' - '記号の後に '--date' *がいくつ期待されますか? 2つ以上の単語を必要とするか、少なくとも処理するGitコマンド/オプションがいくつかありますが、それらのうちの1つは '--date'ですか? – torek

答えて

1

それはように見えます二重引用符(gitのバージョン2.13.1.windows.1を使用して)で動作:

[email protected] D:\git\git 
> git log -n 1 --pretty=format:%cd --date=format:"%d %b %Y" 
15 Jun 2017 

それはあまりにもbashで動作します。

[email protected] MINGW64 /d/git/git (master) 
$ git log -n 1 --pretty=format:%cd --date=format:"%d %b %Y" 
15 Jun 2017 
0

次のコマンドは役に立ちます。

git log -1 --format=%cd 

Abowコマンドは、最新の変更日付を印刷します。 -1には1つのログエントリ(最新のもの)が表示されます。詳細はlinkを参照してください。

関連する問題