Pulling from a bare git --repo that's configured to push to server

49 Views Asked by At

first question here (yay me).

I just started my first job as a Developer a couple months ago, and have recently set up my (very small) company on VCS. We're not using GitHub, but rather pushing local commits to a bare repo, and then that repo has a post-receive hook that deploys the code on the server. This is working well for me individually, and I'm also able to clone the bare repo in order to set up new users with the codebase.

My questions are about pulling to update our individual local repos with what's on the server. It's similar to the question here, but I'm not sure how to format the SOURCE mentioned there given that our repo isn't on GitHub, and haven't had any luck searching elsewhere. I've tried pulling from my local repo when I know there are minor difference, but after the pull my files don't reflect the live code, yet I still get the message "already up to date."

Once we're able to pull, I'm curious how differences will be merged. For instance, let's save dev1 and dev2 have the same, current version of the live code from the server. Then dev1 starts working on something that spans several days. During that time, dev2 makes some small changes and pushes them live. What happens if some of dev2's tweaks happen to be working with the same lines/files that dev1 is working on, and dev1 on tries to pull before he's finished all of his changes?

Through all of my searching on Google and such I've seen plenty of things saying that the bare repo makes all of this stuff easier etc., but I've not found anything explaining exactly why that is.

Thank you all in advance!

0

There are 0 best solutions below