england-and-wales
Proving a fact in court generally means convincing the judge (or jury) that the probability of the fact being true exceeds some threshold. This is known as the "standard of proof". For civil cases the standard of proof is generally "on the balance of probabilities" which means that it is >50% likely that the fact is true.
There is usually not any one thing that is required to prove a fact. What's important is that your set of evidence is more convincing than your opponent's set of evidence. If you can show that you uploaded your code to Github on a specific date, and your opponent's only evidence is that they uploaded the code a month later, then you may have proved your case. If your opponent can additionally show evidence that they emailed a copy of the code to a friend the previous year, then you may have failed to prove your case.
Having a Github commit on a given date doesn't prove that you wrote the code. It's merely evidence that might support such an assertion. Someone else could have written it and then you uploaded it. Ideally it should be just one item of evidence out of a set which, taken together, is as convincing as possible.