I'm new to git and Github. I have learned many of the terms (push, pull, commit, branch, etc), but I'm going to mostly use common parlance to explain my initial expectations.
I assumed the process was:
1.) Create a git repo out of my existing files.
2.) Copy those to my Github account to create a central "hub".
3.) Anyone who works on the project will check it out from Github, do work on their computers, then upload the changes to the hub.
4.) Anyone else working on the same branch can easily upload their changes as well, and will be warned if there are any conflicts. They can also easily download changes since their last download to update their local copy.
So I did step 1 and 2. And I created a few branches. I've made a few commits and pushed the changes to Github. I also cloned the master branch on another machine, and then branched off of that. I pushed the new branch to Github. Everything seems to be working fine. But now, as I prepare to add other developers to the project, I've come across repeated admonitions that the "central" repository should be "bare."
Here, here ("it's not recommended to push into a non-bare repository"), and atlassian says "Central repositories should always be bare repositories", and several other places. Apparently, if it's not bare and someone else pushes a new file, then my local version will consider itself to have deleted that file when I push. I'll end up undoing the work of other developers, the very problem I was trying to fix with git!
That has me worried, since I've already set up my Github project with a bunch of files. I was about to set to work figuring out who to convert my hub to a bare repo, when I came across some information that suggests that with newer versions of Git, you don't need a bare repository at the hub. I think it has to do with version 2.3 having updated behavior for git push
. Is that true and why?
And what do I do if my local Windows machine has version 2.7, but another CentOS machine is using 1.7.1?