Lexxy_B
Lexxy_B

Reputation: 23

Git branching in Visual Studio just show one graph line?

I use Git in Visual Studio as a local version control tool just for myself. Therefore, I have no remote repositories connected and everything runs locally.

My Problem: The Graph only shows one line instead of forked branches. can somebody explain this, please? Please see the below pictures: This is what I got:

Visual Studio

This is what I want:

graph

If the pictures are unavailable:

What I got:            #    What I want
Graph descr.  Branch #    Graph descr.  Branch
--------------------------------------------------------
O    change2    Test   #   | O     change2   Test
|                      #   | |
O    change1    Test   #   | O     change1   Test
|                      #   |/
O    init       master #   O       init      master

I think I have a misunderstanding of how Git actually works, but please help me or show me a good guide.

Thanks in advance !! :)

Upvotes: 1

Views: 996

Answers (2)

VonC
VonC

Reputation: 1328152

If:

  • the DongleFree branch is made on top of TestBranch
  • the TestBranch branch is made on top of master

Then a git log --oneline --graph --decorate --branches --all would show the same as Visual Studio: one single line.

Once you have actual concurrent developments (different commits in two different branches, from one common ancestor), you will see forks in the commit graph.


The OP Lexxy_B confirms in the comments:

This is exactly the Problem! Visual Studio only shows the current Branch.

And this feature is not yet implemented: "View history of multiple branches in the same graph".


As detailed in rtfmpliz's answer, this is implemented in Visual Studio 2022 17.7+.

See "Multi-branch Git Graph"

Building on the work in preview, we've implemented the multi-branch graph to enable visualizing multiple branches in the same graph along with other UI improvements.

https://learn.microsoft.com/en-us/visualstudio/releases/2022/media/17.7/17.7p2-multi-branch-graph.png

It includes the "Cleared Toggled Branches in History" icon to focus on your selected branch in the list:

https://devblogs.microsoft.com/visualstudio/wp-content/uploads/sites/4/2023/08/Clear-Toggled-Branches-in-History.png

Upvotes: 2

rtfmpliz
rtfmpliz

Reputation: 339

there are already update on the visual studio manage branches, now there are toggle to show other branch on the graph

here is detailed explanation https://devblogs.microsoft.com/visualstudio/multi-branch-graph-available-for-general-audiences/

graph other branch toggle

for more info about feature request in below links

https://developercommunity.visualstudio.com/t/how-do-i-view-the-history-of-all-branches-in-git/934801

Upvotes: 1

Related Questions