I got a master branch and develop branch in my GIT. I am trying to pull the commits from develop branch to master branch (as is) along with commit hashes. I see the commits are transferred to master branch with Same Commit message but commit hash. Is there any way I can retain the commit hash when doing cherry-pick or rebase ?
For example:
develop branch has below commits
commitHash | Commit Message
--------------------------
commitHash1 A
commitHash2 B
master branch has below commits
commitHash3 C
I tried the following methods:
Method 1
From Master :
git cherry-pick --ff <commitHash1>
git cherry-pick -ff <commitHash2>
I see now Master has
commitHash4 A
commitHash5 B
commitHash3 C
instead of (Expecting output in Master branch)
commitHash1 A
commitHash2 B
commitHash3 C
Any suggestions ?
Pls note:
This topic is little bit different from :Specifying Git commit hash
I never thought about generating a new hash,
but to retain hash from old branch.
so I can compare all the branches and their commits using
git show-branch --topo-order --sparse --color --sha1-name origin/master origin/stage origin/develop