Skip to content

Conversation

@albert-github
Copy link
Contributor

Unfortunately ...

@albert-github
Copy link
Contributor Author

Didn't work

@sloriot
Copy link
Member

sloriot commented Jan 12, 2026

Dear @albert-github , you can try the following:

> git fetch origin
> git checkout main
> git reset --hard origin/main

(replace origin with the remote name)

@albert-github
Copy link
Contributor Author

@sloriot Thanks for the suggestions, I straight away tried it.

Normally when pushing a proposed pull request I do:

git push origin <branch-name>

and when synchronizing:

git fetch upstream
git merge upstream/main
git push origin main

So I now tried:

git fetch upstream
git checkout main

This gave:

Already on 'main'
Your branch is ahead of 'upstream/main' by 3 commits.
  (use "git push" to publish your local commits)

Next command:

git reset --hard upstream/main

This gave:

HEAD is now at b9916cbb587 Merge remote-tracking branch 'cgal/6.1.x-branch' into 'cgal/main'

Now the "normal push"

git push origin main

but this gave the message:

To https://github.com/albert-github/cgal.git
 ! [rejected]                main -> main (non-fast-forward)
error: failed to push some refs to 'https://github.com/albert-github/cgal.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. If you want to integrate the remote changes,
hint: use 'git pull' before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

Also doing the git pull didn't help ("Already up to date"`, and the error remains.
I don't have any experience with "fast-forward" and the description is quite unclear to me.

So my last resort remains, unless you have some ideas:

  • remove the fork
  • refork

Hopefully this will solve the problem...

@sloriot
Copy link
Member

sloriot commented Jan 12, 2026

Give it another try. (I did git push albert-github cgal/main:main -f)

@albert-github
Copy link
Contributor Author

@sloriot

This looks like to have solved the problem, on GitHub I don't see the messages anymore and also when I just open my local viewer (sourcetree) I don see the reference to 3 ahead anymore.

Should I do some synchronization actions? like git pull or my "normal" update from the CGAL repository(i.e.:

git fetch upstream
git merge upstream/main
git push origin main

Thanks a lot for your help! very much appreciated.

@sloriot
Copy link
Member

sloriot commented Jan 12, 2026

My guess is that you did a push in main that you did not want to do, no need to synchronize.

@albert-github
Copy link
Contributor Author

@sloriot
Might have been the case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants