簡體   English   中英

git 日志 --graph 不顯示分支,它僅將它們顯示為 master 上的提交

[英]git log --graph does not show branches, it only shows them as commits on master

前段時間,在我工作的機構,git 的日志圖曾經顯示每個分支中的提交,然后再將它們合並到 master,但是現在當我們合並一個分支時,它只顯示它們作為 master 上的提交,並沒有顯示分支機構的歷史 這在以前沒有發生過。 為什么會這樣? 謝謝

* commit 
| 
| 
| 
|    
|  
* commit 
| 
| 
| 
|    
|  
* commit 
| 
| 
| 
|     
|  
* commit 
| 
| 
| 
|     
|  
* commit 
| 
| 
| 
|  
|  
* commit 
| 
| 
| 
|     
|  
* commit
| 
| 
| 
| 
| 
* commit
| 
| 
| 
|    
|  
* commit 
| 
| 
| 
|     
|  
* commit 
| 
| 
| 
|     
|  
* commit 
| 
| 
| 
|     
|  
* commit 
| 
| 
| 
|     
|  
* commit
| 
| 
| 
|    
|  
* commit
| 
| 
| 
|     
|    
*   commit 
|\  
| | 
| | 
| | 
| |     
| |   
| * commit 
| | 
| | 
| | 
| |     
| |   
* | commit 
|/  
|   
|   
|       
|  
* commit 
| 
| 
| 
|     
|    
*   commit
|\  
| | 
| | 
| | 
| |    
| |     
| *   commit
| |\  
| | | 
| | | 
| | | 
| | |     
| | |    
| | * commit
| | | 
| | | 
| | | 
| | |     
| | |    
| | * commit
| | | 
| | | 

git_log_graph

默認情況下,Git 嘗試執行“快進”合並,它基本上會從一個分支獲取提交並在合並目標上重放它們。 這僅在合並目標同時沒有提交的情況下才有效(iirc),但這意味着被合並的分支被有效地從進程中刪除,Git 可以快進 master 以滿足它的提示而無需實際上進行任何合並。

您可以使用 'git merge --no-ff' 禁用此功能

您的問題並不完全清楚,但我認為您正在尋找git log的選項之一:

  • 要在日志中添加分支和標簽的名稱,請使用--decorate
    git log --graph --decorate

  • 要查看您的存儲庫中的所有分支,請使用--all
    git log --graph --all

請注意,您可以將兩者結合起來:

git log --graph --all --decorate

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM