简体   繁体   English

如何判断哪个git分支被检出?

[英]How to tell which git branch is checked out?

I have a project on github and I just committed and pushed it. 我在github上有一个项目,我只是承诺并推动它。 However, my changes don't show up on github. 但是,我的更改不会显示在github上。

I think I didn't have the master branch checked out. 我想我没有检查出master分支。 Which means I don't know the name of the branch I'm currently working in. Honestly, I don't really know where I just committed my changes. 这意味着我不知道我目前正在工作的分支机构的名称。老实说,我真的不知道我在哪里提交了我的更改。

How can I find out which branch I currently have checked out? 如何找出我目前检查的分支? How can merge these changes into master ? 如何将这些更改合并到master What did I just do? 我刚刚做了什么?

When I committed, it said: 当我承诺时,它说:

 # Please enter the commit message for your changes. Lines starting
 # with '#' will be ignored, and an empty message aborts the commit.
 # Not currently on any branch.

And then I did a git push , and I have no clue where that was pushed to. 然后我做了一个git push ,我不知道那个被推到哪里。

$ git log

commit dcb85bcfafa18d9dfe9f12659e7ba0e2662ca45e
Author: ...
Date:   Wed May 18 22:41:57 2011 -0400

    Fix for new vm website layout, add CREDITS

Where is my code? 我的代码在哪里? How can I merge it into master? 我怎样才能将它合并到master中?

git branch
git branch --contains dcb85b
gitk --all --date-order

To merge it into master, you could git merge dcb85b or git cherry-pick dcb85b or one of any number of commands. 要将它合并到master中,你可以使用git merge dcb85bgit cherry-pick dcb85b或任意数量的命令之一。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM