Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why doesn't the graph display a new branch branching off from the master branch, when I create a new branch in terminal?

Tags:

Why doesn't the graph in Sourcetree display a new branch branching off from the master branch , when I create a new branch called "testing123" in terminal ?

Sourcetree recognises the new branch but it doesn't branch off from the master branch in the graph. Why is this happening ? How can I make Sourcetree graph display the new branch branching off from master?

enter image description here

like image 222
mynameisJEFF Avatar asked Nov 30 '14 16:11

mynameisJEFF


People also ask

How do you create a new branch in Terminal?

New Branches The git branch command can be used to create a new branch. When you want to start a new feature, you create a new branch off main using git branch new_branch . Once created you can then use git checkout new_branch to switch to that branch.

How do you check from which branch a branch is created?

You can use git branch --contains to list all the branches descended from the tip of develop , then use grep to make sure feature is among them. If it is among them, it will print " feature" to standard output and have a return code of 0.

What is the difference between master and develop branch?

master — this branch contains production code. All development code is merged into master in sometime. develop — this branch contains pre-production code. When the features are finished then they are merged into develop.


1 Answers

It does: it has one new commit done from master.

That means you have checked out the new branch testing123, done one commit and pushed it (hence origin/testing123).

You don't see any "branching" because there is no new commit on master since testing123 has been created: the history of testing123 remains "linear" with the one of master.

Once a new commit will have been created on master, you will see a fork.

See also this thread on SourceTree:

2 possible reasons for this:

  1. You have 'Current Branch' selected at the top of the log view, or
  2. The branches didn't actually cause a divergence in the graph.
    A branch is just a marker, unless different commits actually occurred in each that were not shared between then, there won't be a fork in the graph.
like image 122
VonC Avatar answered Oct 23 '22 21:10

VonC