As of right now, I cant use an git server, so I use one of my favourite git features which is turning any directory in my computer into a git repo ( just the git init
thing).
I use to do this because I was the only one coding and I could keep track of my own stuff. Now things have changed a bit and I'm working with a small team. Some other things however did not change and I still cannot have a git server therefore the local repos are still the only option.
The most straight forward procedure has been to distribute the code to the other guys as zipping my repo and sending it over. When they are done, they send it back to me and I substitute the original repo. Works kind of fine since we almost never have two people working in the same repo due how the projects are organized.
Now, I wish I could do something more consistent.. like, merging whatever they send me into my local repo. This example would allow me to eventually have two people working in the same repo (or maybe subsets of it).
I have been reading about the git patch scripts. But to be honest I didn't feel very comfortable with the solution. First, because in my initial experiments it didnt work straight away (yeah, I know is just a matter of understanding it better, but still, not as intuitive as the rest of git) and second because my repos will also contain binary files which I need to be con开发者_如何学运维trolled as well.. not sure if the patches can handle that :/
Which procedure would you guys suggest to organize this? is there a command which would allow me to merge to repos in the way I describe?
Thanks!
f.
How about sending each other pathches?
git format-patch
and git am
might suit your needs. I've used it in the past and it works well enough for sending infrequent changes.
If you have some way of setting up a shared directory, even if it is on someone's computer, you can do a git init
there and have everyone add that repo as the remote. It isn't as clean as having gitolite or something SSH'd, but should work just fine.
The nice thing about distributed version control is you don't need just one server that everyone can reach all the time. You can have as many servers as you need. You can set up a server or shared directory inside the company firewall, for everyone who has access to use, and have your offsite people each set up their own local ssh or something you can push and pull from as necessary.
If you want to continue your mailing repos around in zip files, all you have to do is instead of replacing your main local repo, unzip it into a separate folder, then do a git pull
from that folder into your main repo in order to merge it in. Not nearly as efficient bandwidth-wise as git format-patch
, but a little more familiar in your particular workflow.
精彩评论