Why changes in one branch can affect the other branch in git? -


  1. i @ master branch,
  2. i commit everything
  3. then create new branch "git checkout -b xxx"
  4. then switch master "git checkout master"
  5. then delete master branch without using "git rm"
  6. i checkouted branch xxx, during branch switching, shows long list every file had status 'd'
  7. then found branch xxx had empty folder too.

it wasn't problem since can revert in branch xxx "gt reset --hard head"

i wonder why deleting behavior @ 1 branch can affect other branch? doesn't branch stored everything?

  1. then tried merge 1 of branch using "git merge xxx", said "alread update date"

this happen because xxx branch merged master , nothing changed in xxx after that.

  1. i checkouted branch xxx, during branch switching, shows long list every file had status 'd'

you haven't commit changes , switched branch xxx, changes moved branch

i wonder why deleting behavior @ 1 branch can affect other branch? doesn't branch stored everything?

yes does. moving changes between branches without commiting see in every "up-to-date" branch. commit somewhere , behave expect

edit: deletion of files same operation modifying git, have commit changes after delete, somewhere between steps 5 , 6


Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -