将 GIT 与 GIT GUI 结合使用 - 主控和分支
我正在尝试 GIT,并使用 GIT GUI(来自 msysgit)。
我正在尝试创建一个新分支,但不知何故它不断接管主分支。 master 分支仍然出现,但不再是实际的 master 分支。 因此,我也无法将我的新分支合并到主分支中,但它要求我做相反的事情(主分支合并到新分支中)。
我遇到的另一个问题(不确定是否相关)是,GIT GUI 不允许我在主分支和分支(带签出)之间切换,而不实际合并两者。据我了解,这并不是主分支切换的必要条件。
谢谢...
I am trying out GIT, and using the GIT GUI (from msysgit) with it.
I am trying to make a new branch, but somehow it keeps taking over the master branch. The master branch still appears, but not as the actual master.
As a result, I also can't merge my new branch into the master, but it requests me to do the opposite (master into new branch).
Another problem that I have come across (not sure if related), is that GIT GUI is not allowing me to switch between the Master and branch (with check out) without actually merging the two. As far as I understood, this is not a necessary requirement for switching between master and branches.
Thanks...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我从未使用过 gitgui,所以我无法帮助您,但您可以尝试在命令行执行相同的操作,以确保事情在该级别正常工作。
要从主分支创建分支并同时将其签出,您可以使用
Where [oldbranch name] will be master。如果省略,则使用当前分支。
要在分支之间切换,您可以使用
切换到目标分支。您可以列出所有现有分支,
学习在命令行中使用 git 可能是一个好主意,您可能会找到更多用于命令行使用的文档而不是用于 gui 使用的文档。
[编辑]
当你说它让你合并两个分支时,你会得到什么错误?当你有脏工作副本时,git 不允许你关闭分支。如果您的工作副本有更改,您需要提交它们,或者如果您不想提交更改,您可以使用
'git stash' 命令(您也可以重置您的头脑并完全丢弃更改)。当你说 git 让你合并两个分支时,这就是你所看到的吗?
I've never used gitgui so I can't help you there but you could try performing the same operations at the command line to make sure things are working at that level.
To create a branch from the master and check it out at the same time you would use
Where [old branch name] would be master. If this is omitted the current branch is used.
To switch between branches you would use
To switch to destination branch. You can list all of the existing branches with
Learning to use git at the command line may be a good idea, you're likely to find more documentation for command line use than for gui use.
[edit]
When you say it makes you merge the two branches what error are you getting? git will not allow you to switch off a branch when you have a dirty working copy. If your working copy has changes you either need to commit them or if you don't want to commit your changes you can stash them using the
'git stash' command (you could also reset your head and throw the changes away completely). Is this what you're seeing when you say that git is making you merge the two branches?