简体   繁体   English

共享硬盘上的Git存储库

[英]Git repository on a shared hard drive

In our office we have a Linux server with a shared drive. 在我们的办公室中,我们有一台带有共享驱动器的Linux服务器。 On this shared drive we have our client web projects and we all work directly in those files. 在此共享驱动器上,我们有客户端Web项目,我们都直接在这些文件中工作。

Now I am trying to get a project into git (at Bitbucket). 现在,我正在尝试将项目导入git(在Bitbucket上)。 When I do it from the command prompt (Windows) using these commands: 当我使用以下命令从命令提示符(Windows)进行操作时:

W:\projectfolder $ git init
W:\projectfolder $ git remote add origin https://username:password@bitbucket.org/mediafolder/rep.git
W:\projectfolder $ git add --all
W:\projectfolder $ git commit -m "Initial commit"
W:\projectfolder $ git push -u origin master

When I reopen the project on my PC, make changes and commit, it only commits the files that were changed, which is correct. 当我在PC上重新打开项目,进行更改并提交时,它仅提交更改过的文件,这是正确的。

Now my coworker opens the folder, makes changes to some files, he has to commit everything all over again, which of course gives errors as there were no changes to most files 现在我的同事打开文件夹,对某些文件进行更改,他必须再次重新提交所有内容,这当然会产生错误,因为大多数文件都没有更改

Does this have to do with access rights to some files? 这与对某些文件的访问权限有关吗?

We could of course clone the project to the local dev environment, but as we have hundreds of projects, it would be overkill to have them all locally installed or every time we need to make one small change have to clone first 当然,我们可以将项目克隆到本地开发环境中,但是由于我们有数百个项目,所以将它们全部本地安装或每次我们需要做一个小更改都必须先克隆都太过分了。

Your help will be much appreciated 您的帮助将不胜感激

We could of course clone the project to the local dev environment 我们当然可以将项目克隆到本地开发环境

That's exactly how git works, it's not meant to store the repository in a shared network location you directly access. 这正是git的工作方式,并不意味着将存储库存储在您直接访问的共享网络位置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM