Hello i have 2 branches
- master
- feature_xyz
Some how it happens a couple of commits which originated in master branch and also in feature_xyz got different commit ids.
So it is not more possible to find out which commits are really related to the feature.
We dont cherry-pick those commits.
How is it possible that a commit got different commit ids? Normaly a commit should have the same id in all branches.
Is there any merge or rebase option that can cause this issue?
Here my try to reproduce
##### simple Test Setup
git init
echo "test" > a ; git add a ; git commit -m "master commit 1"
git checkout -b feature_xyz
echo "test" > b ; git add b ; git commit -m "feature commit 1"
git checkout master
echo "test" > c ; git add c ; git commit -m "master commit 2"
git checkout feature_xyz
echo "test" > d ; git add d ; git commit -m "feature commit 2"
### Test run 1
git rebase master
# Validating by git log master compare to git log feature The commit ids are identical.
##### complex Test Setup
rm ./* ; rm .git -rf
git init
echo "test" > a ; echo "hello" >> a ; echo "World" >> a ; git add a ; git commit -m "master commit 1"
git checkout -b feature_xyz
echo "test" > b ; git add b ; git commit -m "feature commit 1"
git checkout master
sed -i -e 's/World/wOrlD/g' a ; git add a ; git commit -m "master commit 2"
git checkout feature_xyz
sed -i -e 's/hello/HELL/g' a ; git add a ; git commit -m "feature commit 2"
########################
### Test run 2
git rebase master
git mergetool
git rebase --continue
# Validating by git log master compare to git log feature The commit ids are identical.
### Test run 3
git merge master
git mergetool
git commit
# Validating by git log master compare to git log feature The commit ids are identical.
In real world the feature branch is ages old an i have no clue how this effect happen.