8

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?

kevin_b
  • 803
  • 4
  • 16
  • 34
  • on github, check Graphs -> Network, on the graphic git log can you see the last couple of commits? – armnotstrong Aug 03 '16 at 04:15
  • If you try `git push` again, does it say it's already up to date? Is this on the main (master) branch? Is this a public repo which you can share a link to, and the commit id of a missing commit? – phemmer Aug 03 '16 at 04:26
  • @armnotstrong on Graph -> Network, it just says Loading Graph Data and a spinning progress sign. Does not show actual data – kevin_b Aug 03 '16 at 04:27
  • @Patrick yep, when I git push again, it says already up to date, and sorry it's a private repo unfortunately – kevin_b Aug 03 '16 at 04:28
  • @jebmarcus : Same thing happened with me many times on `Bitbucket`. Just try `push` a new `commit` and everything will be updated. – Shravan40 Aug 03 '16 at 04:32
  • @Shravan40 I tried a new commit, basically changed one line and pushed, but same thing, no commits are showing – kevin_b Aug 03 '16 at 04:33
  • @jebmarcus : Are you working in `master` ? – Shravan40 Aug 03 '16 at 04:47
  • this is confusing to me. I used to be able to push with `git push` without having to specify the origin (or the branch). But now I can't push without doing `git push -u origin master`. My removes look fine `originn git@github.com:brando90/ultimate-utils.git (push)` after going `git remote -v`...what happened to my git configuration than now I have to explicitly specify where I am pushing and git push by itself is not longer working? btw this looks related: https://stackoverflow.com/questions/11173971/commits-not-showing-up-on-github – Charlie Parker Sep 02 '21 at 18:08
  • also related: https://stackoverflow.com/questions/11173971/commits-not-showing-up-on-github – Charlie Parker Sep 02 '21 at 18:08

3 Answers3

7

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

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • 1
    Thanks but when I do git branch I do see * master – kevin_b Aug 03 '16 at 13:38
  • When I refreshed the repo this morning everything is working again – kevin_b Aug 03 '16 at 13:38
  • git status said: On branch master Your branch is up-to-date with 'origin/master'. nothing to commit, working directory clean – kevin_b Aug 03 '16 at 13:39
  • So yes, a refresh issue on Github side, then – VonC Aug 03 '16 at 13:39
  • Thanks for your help anyway! – kevin_b Aug 03 '16 at 13:40
  • I will accept this answer as it might help other people in their cases – kevin_b Aug 03 '16 at 13:43
  • @jebmarcus OK, I have updated the answer with your conclusion as well, for more visibility. – VonC Aug 03 '16 at 14:18
  • I am confused also also see `* master`...what is going on? – Charlie Parker Sep 02 '21 at 18:08
  • this is confusing to me. I used to be able to push with `git push` without having to specify the origin (or the branch). But now I can't push without doing `git push -u origin master`. My removes look fine `originn git@github.com:brando90/ultimate-utils.git (push)` after going `git remote -v`...what happened to my git configuration than now I have to explicitly specify where I am pushing and git push by itself is not longer working? – Charlie Parker Sep 02 '21 at 18:09
  • @CharlieParker Could you ask that in a separate question, with your OS, OS version, git version, and output of `git branch -avv`? – VonC Sep 02 '21 at 21:20
2

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.

Noam Manos
  • 15,216
  • 3
  • 86
  • 85
0

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