Bitbucket not showing recent commits, but commits are still present
Asked Answered
D

7

14

We've been working in the same Bitbucket repository for close to three years now. We've got a master branch for production, develop for testing and then tonnes of feature branches. Today I wanted to create a pull request to merge into develop, but in the PR view I got the message "No commits on [branch] that aren't on develop". Then on the commits overview page there are lots of commits missing. Develop seemingly has no commits at all, commits to some feature branches are missing, while for other branches all commits are present.

Pipelines did successfully run though, and if I click on a commit hash for my most recent commit (in the pipeline view), it shows me my most recent commit, along with all changes I pushed earlier. The source code inside Bitbucket reflects those changes as well, while master and develop are missing those changes (in other words, there are definitely commits that aren't on develop yet).

Lastly, commands like git log and git reflog show all changes for all branches as well.

This is currently preventing us from rolling out quite some changes, and I can't find anything anywhere regarding a solution (or a cause, for that matter), so any help would be appreciated.

Edit: I just pushed another branch to remote, and magically all commits have reappeared, including those of other branches. No clue what the logic is, but the problem has fixed itself.

Dockery answered 2/4, 2020 at 23:36 Comment(5)
Did anyone do a force-push to Bitbucket from an older repo?Air
Nope, and even if they did, it would've happened on another branch as I'm the only one working on this branch (there's only two of us, my colleague is currently working on something completely different so I'm 100% sure on this).Dockery
Facing similar issue since the last update of VSCode, all my configs look fine. To make things appear "by magic" having to use tags on the web interface. support.atlassian.com/bitbucket-cloud/docs/repository-tags - this manually solves updating from bitbucket to vscode. I am trying to figure out how to manually debug push now - will try their Bitbucket extension for VSCODe instead of git in the future as well. I have been using bitbucket for over a year in a small team - firts time I face this issue but is persistent for a few days and cost us a lot of hours.Mcgruder
Update - I suspect this is a bitbucket issue - Got the message now "Hmm... can't find that one That file or directory doesn’t exist. Go back to the previous page and try another one." On a perfectly valid branch.Mcgruder
I had a similar situation. I had two commits for the same branch but the pull request only showed the first commit. It did not show the second one. None of the recommendations in this post worked. What worked? I deleted the pull request and created a new one.Paryavi
C
26

Just had a similar issue in Bitbucket with a recently SVN migrated repository. All the commits of our master branch were shown in git log but not in the Bitbucket web.

The solution for us, as pointed out by OP, was to create a dummy branch with at least on commit, and then remove it:

git checkout -b erase-me
touch erase.me
git add erase.me
git commit -am "erase me"
git push -u origin erase-me
git checkout master
git branch -D erase-me
git push origin --delete erase-me

After that, magically all commits were listed correctly in all branches we had in Bitbucket.

Corolla answered 11/8, 2021 at 8:34 Comment(3)
Just experienced the same issue, and you have saved my day. Thanks!Pennywise
You saved me. You absolute legendFancyfree
I don't know why it works, but it works magically.Facile
K
26

I'm experiencing the same problem and I've found an easier trick:

# run the command below:
git commit --amend -a
# this will open your default git editor, just save and exit without any change.
# then run:
git push -f
# this will "refresh" Bitbucket because the commit hash changed

Really annoying

Kootenay answered 6/9, 2021 at 8:36 Comment(7)
I can confirm this worked for me. I suddenly found that 2 years worth of commit messages mysteriously disappeared from BB web, and there was no help on the Atlassian community.Treasurer
This helped me as well. Wonder why this happened in the first placeTarpley
Still worked in 2021 :/ I wonder what Atlassian is doingDihedral
Working like a charm!Transgress
This worked for me as well in 2022Toodleoo
2023 and the problem still exists. This still works!Colloquy
2024 - and this answer helped me!Kayceekaye
R
6

Had the same problem here, just created a new branch and pushed it to Bitbucket and all commits appeared again. This was quite annoying due to this lack of commits we were unable to do pull requests.

Retharethink answered 30/8, 2021 at 15:0 Comment(0)
D
1

I had a similar problem that was related to the email address set on my git config file not matching the email address set on my Bitbucket. I'd run $ git config -l and check it against Bitbucket just to rule it out.

Dublin answered 2/4, 2020 at 23:57 Comment(0)
D
1
  1. Delete the branch from bitbucket web (Remote branch)
  2. Create the branch with same name again
  3. Push your local branch

Above steps solved my issue

Dispart answered 6/1, 2022 at 10:1 Comment(0)
D
1

Started getting a similar issue in BitBucket. Commits up to pull-request creation appears in diff, but when new changes are pushed , they are not visible in PR diff, but commits are shown in branches overview.

Solution was declining the PR and re-open it. This workaround keeps all the reviewers approvals (but not needs-work flag). There is a solution added in this link https://confluence.atlassian.com/bitbucketserverkb/pull-requests-in-bitbucket-server-are-not-updated-after-pushes-to-source-or-target-branch-779171762.html

Diet answered 11/1, 2023 at 8:34 Comment(0)
D
0

None of the above worked for me. What did it was to view my missing commits and changes not on Bitbucket but on Visual Studio (Git -> Manage Branches). I was then able to make further changes and push them back to Bitbucket later. Btw, Bitbucket still continued to show incorrect commit when comparing files with other branches but the individual files themselves look fine with the last commit. Visual Studio allowed me to load and merge changes and then I just confirmed the files looked ok in Bitbucket once they were pushed back there.

Deal answered 8/12, 2022 at 21:43 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.