3 回答

TA貢獻1835條經驗 獲得超7個贊
git log --graph或gitk。(兩者也都接受--all,這將顯示所有分支,而不僅僅是當前分支。)
編輯: 對于分支名稱和緊湊視圖,請嘗試:git log --graph --decorate --oneline

TA貢獻1863條經驗 獲得超2個贊
我通常使用
git log --graph --full-history --all --pretty=format:"%h%x09%d%x20%s"
使用顏色(如果您的外殼是Bash):
git log --graph --full-history --all --color \
--pretty=format:"%x1b[31m%h%x09%x1b[32m%d%x1b[0m%x20%s"
這將打印基于文本的表示形式,如下所示:
* 040cc7c (HEAD, master) Mannual is NOT built by default
* a29ceb7 Removed offensive binary file that was compiled on my machine and was hence incompatible with other machines.
| * 901c7dd (cvc3) cvc3 now configured before building
| * d9e8b5e More sane Yices SMT solver caller
| | * 5b98a10 (nullvars) All uninitialized variables get zero inits
| |/
| * 1cad874 CFLAGS for cvc3 to work succesfully
| * 1579581 Merge branch 'llvm-inv' into cvc3
| |\
| | * a9a246b nostaticalias option
| | * 73b91cc Comment about aliases.
| | * 001b20a Prints number of iteration and node.
| |/
|/|
| * 39d2638 Included header files to cvc3 sources
| * 266023b Added cvc3 to blast infrastructure.
| * ac9eb10 Initial sources of cvc3-1.5
|/
* d642f88 Option -aliasstat, by default stats are suppressed
(您可以只使用git log --format=oneline,但是它將提交消息與數字綁定在一起,恕我直言看起來不太漂亮)。
要為此命令創建快捷方式,您可能需要編輯~/.gitconfig文件:
[alias]
gr = log --graph --full-history --all --color --pretty=tformat:"%x1b[31m%h%x09%x1b[32m%d%x1b[0m%x20%s%x20%x1b[33m(%an)%x1b[0m"
但是,正如Sodel the Vociferous在注釋中指出的那樣,很難記住這么長的格式化命令。通常,這不是問題,因為您可以將其放入~/.gitconfig文件中。但是,如果有時您必須登錄到無法修改配置文件的遠程計算機,則可以使用更簡單但輸入速度更快的版本:
git log --graph --oneline
- 3 回答
- 0 關注
- 661 瀏覽
添加回答
舉報