Git branch is not working as I am expecting

后端 未结 2 920
不思量自难忘°
不思量自难忘° 2021-01-22 21:11

Okay so I am new to using git..and I thought I understood the concept of branching, but now I am confused.

Lets say I have a master.

I create a branch called bra

2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-22 21:40

    Since I didn't commit my changes on branch1, I am expecting my branch2 will not have branch1 codes

    Working copy (staged + unstaged changes) is the same for all branches. And what you see is not the branch1 changes, but the working copy changes.

    Once you commit your changes in branch1, you'll no longer see them in branch2 or any other branch.

提交回复
热议问题