github - git branch - local or what? -


i ran following commands:

(we have staging branch called "master_next")

(1) git fetch origin

(2) git checkout -b origin/master_next

now, when run

(3) git branch

i see weird stuff. instead of seeing

master master_next 

i see

master origin/master_next 

why branch checked out preceded "origin" - somehow different?

here exact results:

cacsvml-13295:smartconnect amills001c$ git fetch origin http://github.csv.comcast.com/baymax/smartconnect  * [new branch]      master_next -> origin/master_next  * [new tag]         0.0.2      -> 0.0.2  * [new tag]         0.0.3      -> 0.0.3 cacsvml-13295:smartconnect amills001c$ git checkout -b origin/master_next switched new branch 'origin/master_next' cacsvml-13295:smartconnect amills001c$ git branch   master * origin/master_next    //wth? 

can explain why happened , how origin/master_next might different plain-old master_next?

the problem in command:

git checkout -b origin/master_next 

this command created new branch origin/master_next instead of checking out branch master_next created remotely.

what should have done:

  1. git fetch origin

  2. git checkout master_next

  3. git branch

the git checkout branch_name command -b creates new branch branch_name , checkouts branch.

git checkout -b new_branch_name #will create new branch , checkout 

Comments

Popular posts from this blog

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -