kevin_b
kevin_b

Reputation: 863

Github repo not showing latest commits

For some reason my Github repo is not showing the latest couple of commits. I did git add, git commit, and git push like I always do. But tonight it seemed to not have registered on the repo's commit history.

When I do a git log, I can see my latest commits. When I do a git pull into a new folder to test it, my changes are there. When I manually take the commit url and put it in my browser, I can see the changes. It is just not showing up on the commit history and the overall number of commits on the project is not updating. Why is this?

Upvotes: 9

Views: 29237

Answers (4)

Jared
Jared

Reputation: 3176

For me, it turned out I happened to have a tag named main and as a result when I'd run git checkout main I would get a warning saying warning: refname 'main' is ambiguous..

The fix for that is to check if you have any branches or tags using

git branch -a

then check your tags using

git tag -l

I had a tag named main so to fix that I ran

git tag main-tag main
git tag -d main
git tag -l

and now after running git checkout main everything is fixed! 🤘

Upvotes: 0

Utpal Patel
Utpal Patel

Reputation: 1

I had a similar issue when I was new to git and trying random stuff but my repo was not taking recent changes even if I do git reset --hard , then I tried this.

git pull

Upvotes: 0

Noam Manos
Noam Manos

Reputation: 17040

Happened to me a similar issue where github did not show latest commits on web. Apparently everything was up to date in my github remote repo, but I just had to re-enter my credentials with git push, in order to see the changes in browser.

First make sure your git user and remote repo are correct:

[repo-dir]$ git config user.email
your-user@email

[repo-dir]$ git remote -v
origin  https://github.com/your-user-name/your-repo (fetch)
origin  https://github.com/your-user-name/your-repo (push)

Then pull and push again:

[repo-dir]$ git pull origin master
From https://github.com/your-user-name/your-repo
 * branch            master     -> FETCH_HEAD
Already up-to-date.

[repo-dir]$ git push

Total 0 (delta 0), reused 0 (delta 0)
To https://github.com/manosnoam/ansible-tempest-remote
   da33d75..ae56129  master -> master

A message has prompted me to enter my git username/password.

Right after that, I saw my commit changes in github web.

Upvotes: 2

VonC
VonC

Reputation: 1329102

Check first your status and branches:

git status
git branch

If you don't see a branch preceded with a *, that means you are working in a detached HEAD branch.

If that is the case, simply reset your master branch to your current HEAD and push again:

git checkout -B master @
git push

The OP jebmarcus confirms in the comments to be on the master branch though, and with a clean status:

When I refreshed the repo this morning everything is working again

That must have been a glitch on GitHub side.
There were connection issues on GitHub (there was a "Minor service outage" on August 3rd -- GitHub status messages).

Upvotes: 7

Related Questions