GIT is missing commits that do exist on the Bitbucket website?
Asked by eelkenet:

2 hours ago I committed and pushed to my Bitbucket repo.

But now, I suddenly cannot get access to commits on the same repo newer than about a year ago.  
I've tried: Tower, Sourcetree, VS Code (Source Control) and the command line.

What the website is showing (identifying information redacted):

![Schermafbeelding 2022-03-28 om 14.18.04.png](https://community.atlassian.com/t5/image/serverpage/image-id/190211i6E31DC1C536BDC24/image-size/large?v=v2&px=999 "Schermafbeelding 2022-03-28 om 14.18.04.png")

What the command line is showing (with \`git log origin/develop -3\`, showing the 3 most recent commits on the same branch) :

![Schermafbeelding 2022-03-28 om 14.22.12.png](https://community.atlassian.com/t5/image/serverpage/image-id/190212i24302624B7565C8B/image-size/large?v=v2&px=999 "Schermafbeelding 2022-03-28 om 14.22.12.png")

This seems like a bug on the Bitbucket side of things, however I've done a pull without thinking and now all work from the last year is missing locally.

What the ..?


Answers:
author: eelkenet
body: Of course, 5 minutes after posting this things work fine again. I guess some monkey threw a wrench into Bitbuckets cogs and now it has come loose.

Keeping the question up in case someone else runs into this too: it may fix itself, automagically!

comments: author: Fokke Oosterhoff
body: Exactly the same happened to us, so this is still an issue.


author: Theodora Boudale
body: Hi [@eelkenet](/t5/user/viewprofilepage/user-id/4842848) and welcome to the community!

I'm a bit confused about what the issue was. The screenshot from the Bitbucket repo (website) shows recent commits, however, your screenshot from the command line shows older commits.

Were you unable to pull the newer commits locally?

We do have a bug with the UI rarely missing commits due to a race condition: <https://jira.atlassian.com/browse/BCLOUD-19548> which can be solved by pushing a new commit or branch to the repo.

I am unsure if this is the bug you came across, as it's not clear whether you were missing commits locally or on the website?

Kind regards,  
Theodora

comments: author: eelkenet
body: Hi [@Theodora Boudale](/t5/user/viewprofilepage/user-id/818086)

Thank you for reaching out. My issue was the exact opposite from the bug you mention, it seems.

What happened was the following: In the hours before this issue, I had made some changes locally, committed and pushed to the remote. Then when I pulled, to make sure all was fine, all commits from ? the last year were removed from my local repo.

Trying to figure out what on earth happened, I noticed I could see my most recent commits as still being listed on the Bitbucket website. However, I could not list, nor pull them from the remote Bitbucket repository. So the Bitbucket website and the Bitbucket repo were completely out of sync.

I tried both with a shell and with GUI tools such as Tower and Sourcetree.

I figured it might be some syncing issue on your end, but after about half an hour I decided to document it and post this question. Then --- right when I had posted it, suddenly my newer commits were showing up again in Sourcetree.


author: Theodora Boudale
body: Hi [@eelkenet](/t5/user/viewprofilepage/user-id/4842848),

Thank you for your reply.

The command 'git log origin/develop' will display the log of the remote branch develop, but its output depends on the remote refs that exist in the local clone. It sounds like the local refs may have been corrupted, I am unsure though why 'git pull' was not updating them properly.

It's hard to troubleshoot this now as the issue is no longer occurring, but please feel free to reach out if this ever occurs again.

The thing I would suggest checking first in such a case would be: take a fresh clone of the repo, checkout the branch with the issue, and pull changes -- do you see the same commits as in the remote? That would be to narrow down whether the issue seems to be specific to the local clone or not.

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud