So I'm pretty new to Git. I've used it for a while locally but never for it's intended purpose of distributed team collaboration.
Background: Recently my company's outside developer started pushing for myself and another employee at my company who have been making minor changes to our website to start commiting to their repo. They use the git flow workflow.
Planned Process: My company is pretty big on processes and controls so we have one person in our IT department who will act as the sort of "gate keeper" if you will. He cloned a copy of our developer's repo to our network, employee #2 and I then cloned from the gate keeper's clone. Employee #2 and I will never go directly to the developer's repo. I checked the gate keeper's clone and he has all the tracking branches for our developer's repo. My clone of his doesn't have any of the tracking branches. To get the tracking branches would he have to checkout all the branches we will need and then have me and employee #2 do a fetch? And will there potentially be issues with getting our branches into his (gate keeper) branch into their (developer) branch.
Here's a little ASCII diagram of the planned process:
Developer repo
|
|
Company "Gate keeper"
/ \
/ \
/ \
me employee #2
It seems like if I don't have the proper develop branch to create feature branches off of it's going to screw things up.
Sorry this was so long, thanks for any help!
tl;dr Working from a clone of a clone without all the remote tracking branches of the original, how do I get them and what are the potential issues?
You and #2 will have the Gatekeeper repo as a remote, and fetch from that. When you do you will only get the state of the local branches of Gatekeeper, at their current respective commit.
So, Gatekeeper would need to git pull
relevant branches to get up to date changes from the Developer repo. Then you can pull from Gatekeeper to get the latest changes.
It seems inconvenient to me, since it depends on the Gatekeeper regularly pulling so that you can pull. Also, what is Gatekeeper supposed to do if there is a change he does not like? git revert
it?
A possibly better alternative to your workflow, would be the Integration-Manager Workflow. The Gatekeeper could be the integration manager, and you, #2 and Developer could be contributors.
What is best depends a lot on the role of Gatekeeper. Is he in charge of the code, or is Developer in charge?