visual studio – Git push over-writes remote without using force?


A co-worker and I have used Subversion for years, but we’re very new to Git. We have a DevOps Git repository (local not cloud). We’re working on the same branch, but we’re not working on the same files. My co-worker is using Git via Visual Studio, and I’m using TortoiseGit.

My co-worker committed and pushed changes to our “central” repository that we’re both using as our remote. I try to always PULL before I commit/push. It seems that one of my pushes has managed to overwrite my coworkers changes. I don’t use Force, and I’m definitely not working on the same files.

If I forget to do a Pull, and I do a Push, does it overwrite files on the remote server without error? I’m used to Subversion where it’ll force me to first update locally before I can commit.

What can cause what I’ve described?

I of course expected my Push to either contain my coworkers changes, or maybe to warn me if I’d forgotten to first do a Pull and maybe my local repo was out of date.

Leave a Reply

Your email address will not be published. Required fields are marked *