我最近很喜欢Git。特别是主题分支。我正在开发一个小型的代码共享应用程序。我有像“master”、“authentication”、“bookmarks”、“comments”、“nose”等本地分支...
我的(预期的)工作流程大致如下:创建主题分支==>在主题分支上工作==>将文件提交到分支==>将主题分支更改合并到“master”分支。(然后删除主题分支)
我尝试对几个分支做同样的事情。它运行良好。但后来当我检查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)