Sharing content from thesis online, before submitting thesis I wrote some piece of code early on in my PhD. It is not genuine research as such but just implementation of already published paper (no public domain code for that paper exist). Because I spent considerable amount of time on it, my guide wants to include it in my thesis as an appendix.

I want to put it on github as well for which my guide has given his blessings! However I am confused about its documentation. I wrote complete introduction and implementation of the problem and code etc which will go in the appendix. Now i want to put that documentation on github as well. But I havent submitted my thesis yet. 

Our departmental policy is that thesis go for plagiarism check before submission. I am afraid during that check my own github repo will show up matching word to word. Is this acceptable? Or shall I wait till I submit?

TLDR: Can portions of thesis be put up online before submission? will it count as plagiarism during plagiarism check?
Ethically, I think you would also be fine. Theses in many fields include content from published papers; GitHub doesn't even count as 'published'.

Practically, it depends on how much blind faith your department places in the plagiarism checker.  Plagiarism detectors should only be used as a first-pass, and humans should evaluate the detected potential plagiarism. If the authorship of your GitHub documentation is clearly labeled, then they will hopefully see that it is your work.

Navigating the details of this in a department-specific setting is what your adviser is there to help you do.  If they've given their blessing, and they are aware of the policy, and they are a good adviser, then I would also expect them to be willing to go to bat for you if it does come up in thesis review.