0

When i am creating new branch using create branch option on bitbucket, it is creating successfully.

But when i go on commits option and choose newly created branch from dropdown under heading COMMITS..it is showing few commits for that new branch.

How it is possible to have commit when branch is new.

Please help me guys.

CodeWizard
  • 128,036
  • 21
  • 144
  • 167
Mr Code
  • 124
  • 10

2 Answers2

1

The commits displayed are onthe branch which you create the new branch from. Assume you create newBranch from master, the structure like:

A---B---C  master
         \
          D newBranch

so the commits shows

D
C
B
A

If you want to show the commits from newBranch, you can view in Branches Tab, select the branch and view the commits in Commits Tab.

enter image description here

Marina Liu
  • 36,876
  • 5
  • 61
  • 74
  • thats work for me. i was looking into my newly created branch from COMMIT option. thats why getting commits under it. Your solution was explanatory. Thanks – Mr Code Apr 12 '17 at 06:06
0

Choose the branch you want to start from (master) and than as you did before create branch from this point.

Another option is to use the command line:

# checkout master
git checkout master

# create new branch out of master
git checkout -b <newB>

# push the new branch to the remote
git push origin newB
CodeWizard
  • 128,036
  • 21
  • 144
  • 167