Sublime Forum

Fatal: NullReferenceException encountered - duplicate files

#1

In Sublime Merge doing a git pull or push I get the following:

Last Command: git pull --ff-only
Status: success
fatal: NullReferenceException encountered.
Object reference not set to an instance of an object.
fatal: NullReferenceException encountered.
Object reference not set to an instance of an object.
Already up to date.

Have a feeling might be an issue with me renaming some files (only changed first letter of file name from lowercase to uppercase) and using Windows Ubuntu. Ended up with duplicate files (couldn’t see the renamed files from the command-line (Windows/Ubuntu), however, Sublime Merge could see them, but couldn’t discard them as it did not have permission to unlink them - I did have full wrx rights to all files and folders at the time). I recloned the repo. I removed the duplicate files, committed, pushed, removed the whole repository, cloned it again (duplicate files are gone now), but still this error when I try pushing the pull or push button. Unfortunately, I can’t remember what I used to rename the files as it was a while ago. Normally, I use git mv, but I can’t be certain - possibly just did a mv on them.

Using ‘git pull --ff-only’ on the command line or in Source Tree does not show up any errors like these, so I’m thinking that maybe it is just an error with Sublime Merge, and the renaming of files and Windows Ubuntu might just be a red herring.

0 Likes

#2

Sublime Merge uses its bundled version of Git by default, which is what’s generating that error. It may be related to https://github.com/git-for-windows/git/issues/1868

If your system version of git isn’t giving you that error, you can point Sublime Merge to use the system version of git via the “git_binary” preference. You can set it to either “system”, and it’ll try to auto detect the path, or you can set it to the full path to git.exe

0 Likes

#3

Hi jps,

Thanks - that did the trick.

BTW, for anyone else who wants to change to use their system version of git don’t forget to wrap the keyword “system” in double-quotes when updating the preference in Sublime Merge.

Thanks again jps.

Philip

PS I also needed to install https://github.com/Microsoft/Git-Credential-Manager-for-Windows/releases/tag/v1.18.2 - No configuration required - just download and install, try to “pull” again and error message will be gone.

0 Likes