2011-05-19 68 views
3

我在github上有一個項目,我只是承諾並推動它。但是,我的更改不會顯示在github上。如何判斷哪個git分支被檢出?

我想我沒有master分支簽出。這意味着我不知道我目前正在工作的分支的名稱。老實說,我不知道我剛剛做了哪些修改。

我如何知道我目前已經簽出哪個分支?如何將這些更改合併到master?我剛剛做了什麼?

當我承諾,它說:

# 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. 

然後我做了git push,我不知道哪裏是被推到。

$ git log 

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

    Fix for new vm website layout, add CREDITS 

我的代碼在哪裏?我怎樣才能將它合併到主人中?

+0

我可以建議看[這個gitcast](http://blip.tv/scott-chacon/git-talk-4113729),當我第一次開始使用git時,它幫了我很多。 – 2011-05-19 03:08:19

回答

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

要合併成高手,你可以git merge dcb85bgit cherry-pick dcb85b或任意數量的命令之一。

+0

聖潔的廢話。這工作。我在理解git時遇到了很多麻煩。非常感謝! – poundifdef 2011-05-19 03:01:56

+1

@poundifdef:我推薦http://progit.org Pro Git書。還強烈建議http://eagain.net/articles/git-for-computer-scientists/計算機科學家Git – 2011-05-19 04:46:23

+1

在Pro Git之前嘗試gitref.org ...這是一個非常好的介紹,涵蓋了所有基本命令,我需要。 – Tekkub 2011-05-19 05:10:24