Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bitbucket not showing recent commits, but commits are still present

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.

like image 417
Alex Avatar asked Apr 02 '20 23:04

Alex


People also ask

Why are my commits not showing on bitbucket?

These missing commits are usually a result of a force push that has rewritten history in the Git repository. Another, less common, cause for missing commits is after a migration to a new filesystem using rsync without the --delete option (see Missing commits in Bitbucket after a filesystem migration for details).

How can I see last commit in bitbucket?

You can see the commit history of a repository in Bitbucket Data Center by navigating directly to the commits page of a repository. You can also view the commit history for a specific file. To view all the commits on a branch in a repository, select Commits.

How do I see all commits on a repository?

On GitHub, you can see the commit history of a repository by: Navigating directly to the commits page of a repository. Clicking on a file, then clicking History, to get to the commit history for a specific file.

How do I see recent commits in local?

Viewing a list of the latest commits. If you want to see what's happened recently in your project, you can use git log . This command will output a list of the latest commits in chronological order, with the latest commit first.


1 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.

like image 147
Fran Avatar answered Nov 06 '22 00:11

Fran