开发者

How to tell which git branch is checked out?

I have a project on github and I just committed and pushed it. However, my changes don't show up on github.

I think I didn't have the master branch checked out. 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?开发者_JAVA百科 How can merge these changes into 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 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?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜