混淆了git分支和主交互 [英] confused about git branches and master interaction

查看:103
本文介绍了混淆了git分支和主交互的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在当地工作。
我检查了一个分支b1并做了一些工作。
我想保持分支b1的样子,但是回到主人那里,因为它像在我检出b1之前那样。但是当我使用git checkout master检出master时,我在分支中所做的所有更改都已经在master中,没有任何提交或合并。我做错了什么?

>在再次签出 master 之前>



如果您在切换分支之前没有提交或隐藏更改,将保留在您的本地文件中,因此将出现您检出的任何分支。


I am working locally. I checked out a branch "b1" and did some work on it. I want to keep the branch "b1" the way it is but go back to the master and for it to be like it was before I checked out "b1". But when I check out master with "git checkout master" all the changes I made in the branch are already in the master without any commits or merges. What am I doing wrong?

解决方案

Did you commit your changes to b1 before checking out master again?

If you do not commit or stash your changes before switching branches, your changes will remain in your local files, therefore will appear whichever branch you have checked out.

这篇关于混淆了git分支和主交互的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆