0

I'm using git GUI on windows, and I ran into errors about git not finding reference for HEAD. So I deleted the current branch from the git repository, and ran the git reset command (as suggested in this thread). Now when I try to push my code to a remove repository (which, as far as I know, shouldn't have changed at all since I last pushed), I get an error saying that the tip of [my] current branch is behind. I absolutely don't want to pull or merge anything from the remote repository. I just want to push my local code to remote. How can I do that ?

Heisenbug
  • 38,762
  • 28
  • 132
  • 190
GuitarExtended
  • 787
  • 2
  • 11
  • 32
  • You can't push if your behind your repo head. Unless you specify --force option, but be mindful on what you're doing. – Heisenbug Aug 05 '19 at 08:14
  • Which precise `git reset` command did you use ? To check remote has not changed, you should run `git fetch` and then better `gitk -15` to see what is going on. – Laurent G Aug 05 '19 at 08:47
  • Please see, this question: https://stackoverflow.com/questions/999907/git-push-says-everything-up-to-date-even-though-i-have-local-changes – Abdel-Raouf Aug 05 '19 at 08:54
  • You could stash your changes if you didn't commit them, doing merge then re-apply them. – Abdel-Raouf Aug 05 '19 at 09:06

0 Answers0