How safe is "git" with an unreliable connection?

Viewed 2635

I am using git for source control and push my changes to a repository on a server on the internet for safe keeping.

I can do some small amounts of coding on a laptop on a train, which has a wifi internet connection but it's not that reliable and occasionally drops out or becomes unusable slow. My question is what happens if my connection is lost during a "git push"? Will I end up with a corrupted or half updated git repository? And if so, how difficult is it to recover it?

2 Answers
Related