I have a project hosted on GitHub and I would like to work locally on it. I have multiple Computers that need to access it and I would like to share code between them. However, I do not want all of these commits to go on GitHub, so a simple "clone and then just push/pull" approach does not suit.
Essentially, I want this:
[GitHub] --> [A Local Network Share] --> [PC1]
--> [PC2]
So PC1 and PC2 should be able to push/pull to the local network share and thus share code between each other, and every once in a while I want to push those changes to my GitHub repository.
I'm a bit lost here - do I just create a branch? Or do I git clone from GitHub to my share and then git clone from my share to PC1 and PC2, which would result them only having 1 remote (the share) and the share only having 1 remote (GitHub)?
Edit: It's not for security - I don't mind when all the immediate commits go to GitHub, and I also don't want to prevent PC2 from accessing GitHub. It's more that I don't want to setup the whole SSL stuff and because I am someone who commits very very often (sometimes every few minutes - I use git commit as an extended undo function), and I want the code on GitHub always to be compilable.
Edit 2: The solutions here did not work for me yet :( So I do
git clone --bare [email protected]:foo/bar
on my server. This creates a clone. On my PCs, I git clone this repository - that step works fine, my PCs have a .git repository and my server is set up as a remote.
However, on the server, nothing is set up properly - there are no remotes added and i can't push from there. Adding a remote is easy using git add, but then how do I push? git status says it requires a work dir (which we don't have with --bare), and git push says "Everything up to date" even though it isn't (I made a change on PC1 and git pushed to the Server)
Creating the repository on the server without --bare means that it has it's own work dir, so when I git push from the PCs, the server does not pick that up (I'm guessing I somehow need git pull from the PCs, but I want to avoid that).
Am I missing a step here?