I figured it out how to do this. In case someone finds this thread while having the same issue, this is how to fix it (based on this thread):
- In the Obsidian settigns, go to ‘Files and links’ under ‘Options’ and change the setting ‘new link format’ to ‘absolute path in vault’.
- In the same window disable the setting ‘use [[wikilinks]]’.
GitHub can make use of the standard markdown links, which does remove the ‘!’. When using this setting with absolute paths, the lack of forward slash in the path does not seem to matter.