That’s not right. You can very much apply trademarks to open-source software. See for example Mozilla Firefox. Also, open-source and public domain are not the same thing. Finally, git is GPL.