Why changes in one branch can affect the other branch in git? -
- i @ master branch,
- i commit everything
- then create new branch "git checkout -b xxx"
- then switch master "git checkout master"
- then delete master branch without using "git rm"
- i checkouted branch xxx, during branch switching, shows long list every file had status 'd'
- 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?
- 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.
- 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
Post a Comment