Have you considered Emacs + Org-mode? Works wherever Emacs works (Linux, Mac) and there are apps for Android and iOS. Org files are basically text files that you can commit to git or sync via Google drive, Dropbox, OneDrive etc. Not exactly markdown but GitHub renders org file pretty well.
After trying out multiple note taking apps this is what I settled on. You can use it as simple as a note taking app or configure it to do lots of complicated things like managing your to-dos, appointments, agendas. And my favorite feature is inline code-block that I can execute.