Bitbucket not showing recent commits, but commits are still present

Viewed 12245

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.

5 Answers

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.

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

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.

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.

  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

Related