【发布时间】:2010-02-04 02:35:51
【问题描述】:
注意:我不确定这是否已经被问过,因为我找不到任何适合我的上下文的问题(或者我无法理解现有问题的上下文')
这些天我爱上了 Git。特别是主题分支。我正在开发一个小型代码共享应用程序。我有(本地)分支,如“master”、“authentication”、“bookmarks”、“cmets”、“nose”等......
我的(预期的)工作流程是这样的:创建主题分支 ==> 处理主题分支 ==> 将文件提交到分支 ==> 将主题分支更改合并到“主”分支。 (后来删除主题分支)
我尝试为几个分支做同样的事情。它工作得很好。但后来当我检查 git 图时,即使我遵循相同的工作流程,所有的机会都发生在“master”上。没有树线发散和汇聚!它显示了从那时起包含多个提交的单行。我不确定为什么?我的印象是,我用 HEAD 指针搞砸了什么?
为了给出一个实用的观点,这是我的 git 图:http://github.com/none-da/zeshare/network
以下是我使用的命令:
>> git branch authentication_feature
>> git checkout authentication_feature
>> # I work with all the files here in "authentication_feature" branch
>> git commit -m "Authentication_feature is up" # commiting to the branch
>> git branch # just to confirm, which branch I am working on
>> git checkout master # trying to shift to master branch
>> git merge --no-commit authentication_feature # I merge in two steps. This is step 1
>> git status;git add; git commit -m "Authentication_feature" merged to "master". # This is the step 2
>> git log --graph --pretty=oneline # confirming the graph
>> git push origin master # pushing to the remote server(github)
【问题讨论】:
-
您的链接对我不起作用。你是如何创建分支的?我认为我们需要更多信息,例如您使用的命令。
-
恐怕没有足够的详细信息来回答(链接也会超时),请确保您遵循任何教程/手册并查看是否获得相同的结果。检查您进行更改的分支等等。
标签: git github merge branch commit