git - Why it seems that I have all my commit in the same branch also if I created a new one and commit into this new branch? -


i new in git , have following doubt branches.

i have used following command create new branch named easy-mode:

git branch easy-mode 

then see al branches , output:

andrea@andrea-pc mingw64 ~/documents/ws_vari/version-control/asteroids (easy-mod e) $ git branch * easy-mode   master 

so should means easy-mode branch correctly created , in moment active branch. true?

ok, have modified file named game.js, have added staging area , have committed it. expect commit related easy-mode branch active branch.

the problem trying show commit graph obtain these result:

andrea@andrea-pc mingw64 ~/documents/ws_vari/version-control/asteroids (easy-mod e) $ git log --graph master easy-mode * commit 59b4bce5964825b7c6fec4270ba34d2166f5168e | author: andrea nobili <nobili.andrea@gmail.com> | date:   thu jul 28 13:17:01 2016 +0200 | |     make asteroids split 2 smaller pieces instead of 3 | * commit cba1887f66a579e81c70a607d8402e84fa6e966d | author: andrea nobili <nobili.andrea@gmail.com> | date:   thu jul 28 12:30:06 2016 +0200 | |     fixing: fixed bug related of weapon delay | * commit 3884eab839af1e82c44267484cf2945a766081f3 | author: cbuckey <caroline@udacity.com> | date:   fri apr 29 12:33:05 2011 -0700 | |     add color | * commit 3e42136a76cf78c6c421cd720427bf6337c2d623 | author: doug mcinnes <doug@dougmcinnes.com> | date:   tue mar 15 22:34:49 2011 -0700 | |     using requestanimationframe | |     see more info: |     http://paulirish.com/2011/requestanimationframe-for-smart-animating/ | * commit 4035769377cce96a88d5c1167079e12f30492391 | author: doug mcinnes <doug@dougmcinnes.com> | date:   wed jun 9 21:04:32 2010 -0700 : 

so performing command:

git log --graph master easy-mode 

and expect see master branch branched easy-mode branch containing last commit (commit 59b4bce5964825b7c6fec4270ba34d2166f5168e) easy-mode branch.

but seems me have no easy-mode branch , commits on same line.

why? wrong? missing?

edit 1:

this output of git log --graph --oneline --decorate --all command:

andrea@andrea-pc mingw64 ~/documents/ws_vari/version-control/asteroids (easy-mod e) $ git log --graph --oneline --decorate --all * 67e5e37 (head -> easy-mode) feature: easy mode, asteroids split in 2 instead of 3 * cba1887 (master) fixing: fixed bug related of weapon delay * 3884eab (origin/master, origin/head) add color * 3e42136 using requestanimationframe * 4035769 frame interval set wrong after game paused * 25ede83 couple missing ends ipad version * df03538 can't spell 'screen' apparently :) | * 354dfdd (origin/coins) make ships able spawn on coins | * 0c6daf1 make possible collect coins | * a3c0ae4 create helper functions | * 656b02e first pass @ adding coins |/ * b0678b1 revert controls * f19cb1b fix typo in space * 75928a9 use space movement , enter shooting * ac83b72 finished ipad version 

as can see last commit is:

* 67e5e37 (head -> easy-mode) feature: easy mode, asteroids split in 2 instead of 3 

i can't understand if new easy-mode branch or if master branch because in printed graph can't see |/ identify new branch graph (as coins branch showed previous output).

why? missing?

in order create and checkout new branch in 1 command

git checkout -b easy-mode 

the common command see branches neatly labeled 1 line commit message

git log --graph --oneline --decorate --all 

i assign these long common commands alias

git config --global alias.la 'log --graph --oneline --decorate --all' 

now you'll able call with

git la 

Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -