亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

在git中可視化分支拓撲

在git中可視化分支拓撲

Git
慕碼人2483693 2019-10-23 15:10:40
我在自己的機器上孤立地使用git,并且發現很難維護我所有分支和提交的思維模型。我知道我可以git log從自己所在的位置查看提交歷史,但是有沒有辦法查看整個分支的拓撲結構,例如這些ascii映射,似乎在各處都用于解釋分支?      .-A---M---N---O---P     /     /   /   /   /    I     B   C   D   E     \   /   /   /   /      `-------------'感覺就像有人進來并嘗試拿起我的存儲庫將很難弄清楚到底發生了什么。我想我受AccuRev的流瀏覽器的影響了...
查看完整描述

3 回答

?
qq_花開花謝_0

TA貢獻1835條經驗 獲得超7個贊

git log --graph或gitk。(兩者也都接受--all,這將顯示所有分支,而不僅僅是當前分支。)


編輯: 對于分支名稱和緊湊視圖,請嘗試:git log --graph --decorate --oneline


查看完整回答
反對 回復 2019-10-23
?
小唯快跑啊

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


查看完整回答
反對 回復 2019-10-23
  • 3 回答
  • 0 關注
  • 661 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號