如何在 GIT 中保持最新的可见文件夹?

发布于 2024-11-23 18:16:05 字数 651 浏览 0 评论 0原文

是的,经过一番努力,我终于在我的所有同事之间获得了一种共享文件夹,我们可以在其中创建一个通用的git存储库。

谷歌搜索如何实现这一点,显然我唯一需要的就是设置一个神奇的标志 git config --bool core.bare true 并且每个人都可以愉快地 push > 和 pull 将远程设置为 file:///z/path/to/that/folder/

辉煌。但我想要更多。

有很多人可以访问我们的文件,但不要 git,如果你明白我的意思:)

现在我注意到的是,在将存储库设置为 bare< 后/code> 工作树不再更新(好吧......我想这正是将其设置为 bare 的目的)。但我希望工作树始终反映主分支的 HEAD。

更进一步,我们实际上以一种“无git”的人无法编辑工作树的方式处理权限(假设我们设法使其按照描述的方式工作),但如果有任何改变那就太好了在 master:HEAD 中立即覆盖工作树中发生的任何更改。即不必费心产生冲突和合并。

还有其他标志可以让我的想法成真吗? :)

谢谢!

f.

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, apparently 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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

递刀给你 2024-11-30 18:16:05

我将保留主存储库的工作目录,并设置一个非裸存储库来托管公共工作目录。

您想要查看 git help hooks,并在主存储库中设置一个合并后钩子,以告诉公共工作目录存储库拉取更改。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文