Some help with git, please?

Hi folks,
I hope I can get a little bit of help with git here. So, I’m doing the Norwegian translation of darktable. This has happened to me a few times now, and I haven’t found a good solution.

I have a git branch called nb-update, where I do my translation work. After a session in Poedit, I do

git status

and the result is

> On branch nb-update
> Your branch is up to date with 'origin/nb-update'.
> 
> Changes not staged for commit:
>   (use "git add <file>..." to update what will be committed)
>   (use "git restore <file>..." to discard changes in working directory)
> 	modified:   po/nb.po
> 	modified:   src/external/rawspeed (new commits)
> 
> no changes added to commit (use "git add" and/or "git commit -a")

The problem is

> modified: src/external/rawspeed (new commits)

I have not touched this. How can I get rid of it and why does this happen?
I can commit my changes to nb.po, but when I try

git push origin

to upload to Github, I get

To https://github.com/Hpbirkeland/darktable.git
 ! [rejected]              nb-update -> nb-update (non-fast-forward)
error: failed to push some refs to 'https://github.com/Hpbirkeland/darktable.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.

Today, just before I did the translation work, I had synced my fork and built darktable 5.7.0+1019, and as far as I can see I have the latest changes, like the sat vs sat module and the stage 2 contrast and texture module.

Can anybody give me some advice about cleaning up this mess?

Just don’t stage the rawspeed submodule for commit. Stage only your PO file.

The message from github seems to indicate that you have a different history in the github repo than you have on your local machine.

I think rawspeed was recently updated. I think you need to do a git submodule update.

Thanks for you replies.

As you can see in my post, rawspeed is not staged. And staging only the .po file does not solve the problem.

I’ll look into this. But I still don’t understand it all. Thank you.

This happens because the rawspeed submodule pointer was bumped in the main repo. That change came into your local repo and branch possibly through clicking “sync fork” and then pulling. git doesn’t update the local submodule checkout automatically, so the local files are still on the old commit. Fix it with git submodule update --init. To have git do this automatically in the future when pulling, run git config submodule.recurse true.

After a bit back and forth it now seems to be sorted. Let’s just hope it stays that way :grinning:.

Thank you for your help.