1

If I try to push any my commit, then I receive the next error:

git.exe push --progress "origin" master:master

Counting objects: 3, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 7.54 MiB | 240 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0)
error: failed to push some refs to 'https://...'

I checked in git log, and it still shows that my commit is not on the remote server. But tricky part is that it actually pushed. If I try to clone this repository to new folder, then I can receive my previosly pushed files.

If I will use fetch command then remote/origin is automatically switched to my commit in log.

We are using TFS GIT as a server and TorotoiseGit as a GUI for git.

Serbin
  • 743
  • 6
  • 24
  • The issue was in some mess at git config files. I just replaced my own configs with one from my collegue. Unfortunetaly, I didn't find which settings caused that issue. – Serbin Feb 21 '17 at 07:19
  • *Before* that error message, Git prints informative messages about what it *could* push and what it *could not* push. Those are what you should pay attention to—the final message is merely a summary, pointing out that there are earlier messages that need attending. – torek Feb 21 '17 at 08:26
  • Added full message from git – Serbin Feb 21 '17 at 08:42
  • Hm, that's rather peculiar. There should be lines of the form: `d1574b8..11ae6ca master -> master` or `! [rejected] master -> master`. It seems that perhaps there is a bug in your Git, that it doesn't print these. – torek Feb 21 '17 at 08:54

1 Answers1

0

It seems you didn't synchronize the remote repository with local repo. You can roll back Git to your previous commit without changing the files, then creating a new commit:

git reset --mixed origin/master
git add .
git commit -m "xx"
git push origin master

More information, check this case: git error: failed to push some refs to

Community
  • 1
  • 1
Cece Dong - MSFT
  • 25,734
  • 1
  • 13
  • 30