與此問題相關的存儲庫位於here。GitHub:將主提交應用到另一個分支
我從主分支創建了一個名爲apt-offline-python3-dev
的新分支,其中的
GitHub Web界面。
我想要做的是接管主分支提交從提交774 - 784,因此讓他們屬於,而不是屬於master
分支的分支apt-offline-python3-dev
,。
因爲,當你看latest提交例如重組之前,上面清清楚楚地寫着的主代替的apt-離線python3-dev的,因爲我發送的所有這些提交到主分支,它是合乎邏輯的, 存儲庫。
話,我想主分支復位到原來的狀態,這意味着回犯9f2f667d13截至6月16日在this頁面看到,2013年
現在,我知道git cherry-pick
和git merge
,但不要真的不知道這是否可能。
更新:
+1馬特的回答帶領我在正確的方向。不幸的是,仍然存在問題。
這裏發生了什麼,當我在馬特暗示順序發出命令:
git checkout apt-offline-python3-dev
Branch apt-offline-python3-dev set up to track remote branch apt-offline-python3-dev from origin.
Switched to a new branch 'apt-offline-python3-dev'
git cherry-pick 9f2f667d134330c0de8700258ab98cae0ac89438
error: could not apply 9f2f667... half implementation of lock, please verify
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
,因爲它已經無法在這裏,沒有必要調用git revert
命令。現在
,如果一個翻轉的順序,並取代git revert
與git reset --hard
,它的實際工作:
git reset --hard 9f2f667d134330c0de8700258ab98cae0ac89438
HEAD is now at 9f2f667 half implementation of lock, please verify
git cherry-pick ba8662eb8e01cebc969126650baa22776a27430d
[apt-offline-python3-dev 78c9aa5] Another initial test commit
Author: codingaround <[email protected]>
24 files changed, 1438 insertions(+), 1328 deletions(-)
create mode 100644 IMPORTANT_README.md
rewrite apt_offline_core/AptOfflineMagicLib.py (85%)
一個git log
顯示,散列是一個新問題:
git log
commit 78c9aa5b732d559f141c9bf77c801c1644710432
Author: codingaround <[email protected]>
Date: Mon Sep 30 20:11:55 2013 +0200
Another initial test commit
的疑問,現在仍然是:我如何保持提交哈希或不可能?