How to keep a up-to-date visible folder in GIT?
Right, after much struggle I finally managed to get a sort of shared folder among my all workmates where we can make a common git
repo.
Googlin' on how to make that work, apparent开发者_高级运维ly the only thing I need is to set a magic flag git config --bool core.bare true
and everyone is able to happily push
and pull
having set the remote as file:///z/path/to/that/folder/
.
Briliant. But I want more.
There are lots of people who will have access to our files, but do not git then, if you know what I mean :)
Now what I noticed is that after setting the repo as bare
the working tree is not updated anymore (well... I guess that's exactly the point of setting it bare
). What I wish though, is that the working tree always reflected the HEAD of the master branch.
Even further, we have actually worked the permissions in a way that the "gitless" people won't be able to edit the working tree (provided that we manage to make it work the way described), but it would be great if any changes in the master:HEAD instantly overwrote whatever was changed in the working tree. i.e. do not bother generating conflicts and merges.
Are there any other flags that would make my gits come true? :)
thanks!
f.
I'd leave the working directory of the master repo alone, and set up a non-bare repository to host the public working directory.
You want to look at git help hooks, and set up a post-merge hook in the master repo to tell the public working directory repository to pull changes.
精彩评论