I’m new to git, and it says that one of its features is everything is local, so you commit changes when not online.
What happens if you go offline, make several changes, commit etc. And a few minutes later, before youre back online, another person makes changes, some of which are in the same place you’ve made you’re changes. Both are unaware that they’ve made the same/similar changes. What happens when the changes are pushed to the server?
Which changes get “put in”
The first one who pushes to the shared repository can push their commits without problem. When the second person tries to push their changes, git detects a conflict and rejects the push. The second person then has to pull the first person’s changes first and merge them into their local repository. After a successful merge, person 2 then pushes the merged changes to the shared repository.