你沒有提供有關歷史的拓撲結構細節,與一般情況下這樣開始和創建hotfix
給
$ git checkout -b hotfix upstream/master
$ git lola
* 81a514a (dev) Stupendous feature
* cb4d5e6 Great feature
* d4a7906 Cool feature
| * 39e449a (HEAD, upstream/master, hotfix) v0.2
|/
* 264ddbc (master) v0.1
注:git lola
是一個非標準的,但非常有用的別名。
合併hotfix
到master
給
* 567f066 (HEAD, master) Merge branch 'hotfix'
|\
| * 1b1b6e3 (hotfix) Fix nasty bug
| * 39e449a (upstream/master) v0.2
|/
| * 81a514a (dev) Stupendous feature
| * cb4d5e6 Great feature
| * d4a7906 Cool feature
|/
* 264ddbc v0.1
合併hotfix
分別向dev
是那裏的東西去偏離軌道。
* 36aa1c8 (HEAD, dev) Merge branch 'hotfix' into dev
|\
* | 81a514a Stupendous feature
* | cb4d5e6 Great feature
* | d4a7906 Cool feature
| | * 567f066 (master) Merge branch 'hotfix'
| | |\
| |//
|/|/
| |/
| * 1b1b6e3 (hotfix) Fix nasty bug
| * 39e449a (upstream/master) v0.2
|/
* 264ddbc v0.1
在這一點上,master
不是dev
,但它的兄弟的直接祖先。
增加更多的承諾到dev
使master
其偉大的叔叔。
* d89aa74 (HEAD, dev) Jason does it again
* a4dd5bf Jason saves the day
* 36aa1c8 Merge branch 'hotfix' into dev
|\
* | 81a514a Stupendous feature
* | cb4d5e6 Great feature
* | d4a7906 Cool feature
| | * 567f066 (master) Merge branch 'hotfix'
| | |\
| |//
|/|/
| |/
| * 1b1b6e3 (hotfix) Fix nasty bug
| * 39e449a (upstream/master) v0.2
|/
* 264ddbc v0.1
回想dev
由一個特性分支的方式獲取到master
,並通過--no-ff
合併。也許release-1.0
從您的修補程序開始,並獲得另一個錯誤修復。
* f0398ba (HEAD, release-1.0) Bugfix for v1.0
* d89aa74 (dev) Jason does it again
* a4dd5bf Jason saves the day
* 36aa1c8 Merge branch 'hotfix' into dev
|\
* | 81a514a Stupendous feature
* | cb4d5e6 Great feature
* | d4a7906 Cool feature
| | * 567f066 (master) Merge branch 'hotfix'
| | |\
| |//
|/|/
| |/
| * 1b1b6e3 (hotfix) Fix nasty bug
| * 39e449a (upstream/master) v0.2
|/
* 264ddbc v0.1
假設按鈕了釋放,這可以追溯到master
與
$ git merge --no-ff -m "v1.0" release-1.0
$ git lola
* 5a384c8 (HEAD, master) v1.0
|\
| * f0398ba (release-1.0) Bugfix for v1.0
| * d89aa74 (dev) Jason does it again
| * a4dd5bf Jason saves the day
| * 36aa1c8 Merge branch 'hotfix' into dev
| |\
| * | 81a514a Stupendous feature
| * | cb4d5e6 Great feature
| * | d4a7906 Cool feature
* | | 567f066 Merge branch 'hotfix'
|\ \ \
| |//
|/|/
| |/
| * 1b1b6e3 (hotfix) Fix nasty bug
| * 39e449a (upstream/master) v0.2
|/
* 264ddbc v0.1
當然,對於你確切的修復取決於你的歷史細節。
爲什麼你想快速合併開發主人? –
@alexeyten,我想避免合併提交...從[文章](http://nvie.com/posts/a-successful-git-branching-model/)*當開發分支達到穩定點,是準備發佈,所有的變化應該合併回主**以某種方式*** –