git 分支失效问题
PHP中文网
PHP中文网 2017-05-02 09:22:55
0
3
582

不知道怎么回事,git创建新的分支,然后在分支里面修改,结果master也跟着同步改了,不应该是在没合并之前,在分支里面的修改不影响master的吗
这是我的所有分支情况
git branch -a

  dev
* master
  remotes/origin/HEAD -> origin/master
  remotes/origin/master

请问一下这个是什么情况呢

PHP中文网
PHP中文网

认证0级讲师

reply all(3)
Ty80

@bordertownmadman I created the branch through git checkout -b. . . I just switched over, and then I created and modified files in the branch. After committing, I returned to master and found that the previously created and modified files were synchronized before they were merged. .
I cloned it again and created a new branch. It seemed to be fine. I don’t know why--!

我想大声告诉你

Are you sure you switched branches through checkout after creating the branch?
If there is no switch, you are still on the original branch

Look git help branch, there is a sentence

in it

the current branch will be highlighted with an asterisk.

That is, the one marked with an asterisk is the current branch... so you are not currently on the dev 分支上,还是在 master branch.

为情所困

Are you sure you committed and then checked out? Did you get the order wrong? Do you checkout first and then commit?

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!