Hi,
I've setup a remote on Github with LFS enabled. Running git-annex sync --content
failed to push on the main branch :
pull lfstest
From github.com:myuser/myremote
* branch HEAD -> FETCH_HEAD
ok
push lfstest
Everything up-to-date
To github.com:myuser/myremote.git
! [rejected] main -> main (non-fast-forward)
error: failed to push some refs to 'github.com:myuser/myremote.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
ok
Is this an expected behaviour ? Is it possible to correct the push failure ?
Thansk in advance
This doesn't involve LFS at all, it's a regular git branch being pushed in the regular way. So you can certianly solve the problem with some combination of
git pull
,git merge
, andgit push
.That said, I don't know why
git-annex sync
didn't work in your situation. I created some test git-lfs repos on github and never saw any difficulty syncing with them.Thanks for answering. I managed to correct it with force-pushing it :
git push lfs main -f
. Not sure why it did not work before but it seems to be working now.