I have some commits that have vanished from our RELEASE Branch (the branch we use to publish to production).
For the sake of argument let's refer to them as commits B
, C
, D
and E
.
Essentially what happened is that I merged some commits from my fix into this release branch.
If I checkout my branch at this point I see the history of changes applied before it including changes made by a couple of developers from a few days prior.
However, if I then check out the next commit, a specific range of 4 commits from a few days prior vanish.
That next commit is a merge from the master branch into release.
There are quite a few commits here but absolutely none of them mention the files from the "vanished" commits.
The merge was done with the following commands:
git checkout master
git merge release
git push
git checkout release
git merge master
git push
At which point, the previous commits were vanished.
Looking at the latest copy of release, commits A
, F
, G
... are all there. As well as the work merged over from master.
But somehow B-E
do not show up and there's no history indicating a revert anywhere.
After commit B
, one developer branched off of RELEASE and subsequently checked some changes over onto master.
Perhaps that threw things off?
There are no commits indicating a revert, and from SourceTree
, if I log any of the selected files I don't see the commits in history.
Running git branch --contains
, however, shows these commits to be on both release and master.
Commit E
is a Merge branch 'RELEASE' into RELEASE
commit indicating the developer did a pull here... nothing unusual really.
I know this may be too vague but I'm not that strong at Git and am not sure what details are helpful here for an answer. I'm happy to provide any additional info that I can, though. With that being said, here is the graph. Commits B-E are indicated by the hash codes of BBBB, CCCC, DDDD, EEEE. I believe commit XXXX is where I synced with the latest in RELEASE, and commit YYYY is where the changes from B-E 'vanished'.
C:\Users\AcmeCoDev7\Documents\GitHub\1.0 [release]> git log --graph --oneline --decorate
* YYYY (HEAD -> release, tag: v0.0.573, origin/release, origin/master, origin/HEAD, master) Merge branch 'release'
|\
| * XXXX Merge branch 'release' of https://github.com/AcmeCo/1.0 into release
| |\
| | * 62ea661 (bug fix) encode...
| | * 6f768f9 Merge branch 'dev_branch' into release
| | |\
| | * \ 8b2e629 Merge branch 'dao_optimize' into release
| | |\ \
| | | * | c5c333b (origin/dao_optimize) removing stuff
| | | * | ea1d574 Yank out images
| | * | | ecce9a2 Fixed NPE
| | |/ /
| | * | 9713b1e Merge branch 'release' of https://github.com/AcmeCo/1.0 into release
| | |\ \
| | | * \ 1dfcd3d Merge branch '658-analytics' into release
| | | |\ \
| | | | * | c98a2ca (origin/analytics) null check
| | * | | | d2c9ef0 Added exception detail
| | |/ / /
| | * | | 156b40e Implementing check
| * | | | 1a65293 Round up/round down for different types
| |/ / /
| * | | 43646b5 logging
| |/| |
| * | | f83e4c6 add Integration tests
| * | | 8a862e8 adding javadocs
| |/ /
| * | EEEE Merge branch 'release' of https://github.com/AcmeCo/1.0 into release
| |\ \
| | * | dfee3b8 Remove stuff
| * | | DDDD Added null check
| |/ /
| * | CCCC fix bug where bundles kits werent showing in yoy growth
* | | 9a32b08 Merge branch 'dev_release_local_branch'
|\ \ \
| * | | f1e3762 716 :: the edit form for a product is not displayed
| * | | e147fa9 716 :: the edit form for a product is not displayed
| |/ /
| * | BBBB roll up inventory
| * | 889c26f Merge branch 'lock-step-chunck' into release
| |\ \
* | \ \ 341e729 Merge remote-tracking branch 'origin/670-lock-step-chunck'
|\ \ \ \
| | |/ /
| |/| |
| * | | c7d0675 (origin/670-lock-step-chunck, 670-lock-step-chunck) 670 :: remove the locking listener