Git:说master是最新的,但是当删除分支时它说它不是'

时间:2013-01-16 19:05:02

标签: git version-control github

我为1.0.2修复创建了一个新分支。一旦我完成了,我想把它们合并回我的主人,所以我使用了:

git merge 'v1.0.2'

但是,它告诉我它已经“已经是最新的”了,这很奇怪。我说,好的,没关系,所以我尝试删除分支:

git branch -d 'v1.0.2'

但现在它告诉我error: The branch 'v1.0.2' is not fully merged.

为什么我的更改首先没有合并?我是否需要以某种方式迫使它们合并?

修改

git log --all --oneline --graph --decorate

的输出
* a783018 (HEAD, origin/master, master) Updated with 1.0.2 changes
* c208285 Updates
| * 655b0ea (v1.0.2) Submitted 1.0.2 to apple for review
| * 0d4f33d Updates
|/  
| * 02f7155 (origin/v1.1, v1.1) Additional fixes
| * 5a68697 Renaming classes and .m .h files with three letter prefixes to comply with Apple requirements
| * c90a76d Added pin pad as an option
| * 3dc6ceb Adding new security methods to lock app if the user chooses
| * 3bf1c88 Updates
|/  
* 71af916 Bug fixes
* 523672f (tag: v1.0.2) Final fixes before release
* 0269dab Bug fixes and added new methods to specifically layout details screens
* e1e7c08 Bug fixes
* 071c9cc (tag: v1.0.1) Last changes before 1.0.1 submission
* 8d56576 Bug fixes
* 9e86414 Major file restructure for easier git viewing and structure
* 4f14c9e Updated a few methods to no longer use the Utility object
* 1be42ea Moved some properties to the ZSSingleton rather than the Squiz Matrix singleton
* 1450e7d Updated a few code snippets
* 27c3ebb Updated methods for Metadata
* baf8a6c (tag: v1.0) Final fixes, submitted to apple
* d5ffb6c Addtional fixes
* aa7d123 Removed unused files
* a472a1d Removal of old Matrix library. Removal of ASIHTTPRequest!
* b533ac3 Added new attribute types
* 76c29ef Adding UIDatePicker for creating of Calendar assets
* 1fb09dc Added some fixes for ipad
* 0f93c82 Cleaning up of code, adding comments
* 27c7984 Cleaning up of code, adding comments
* d0d29bb Added ignore file
* 7911483 A file was deleted
* fdba63c First add of all files

2 个答案:

答案 0 :(得分:2)

您需要在另一个分支上合并它们。所以

git checkout master
git merge v1.0.2
git branch -d v1.0.2

看来你的合并失败了。它告诉你它已经是最新的并不好。尝试将--allow-empty添加到合并中,以便对其进行测试。发出合并命令时,请确保您使用master。

答案 1 :(得分:1)

试试这个:

git checkout master
git merge refs/heads/v1.0.2

您显然拥有名称为v1.0.2的分支和标记,并且git merge v1.0.2似乎更愿意猜测您要与标记合并,而不是分支。上面的语法明确表示您想要合并分支。