简体   繁体   English

为什么Git版本控制无法更新远程位置的文件

[英]Why file at remote location is not getting updated by Git version control

I followed this How to create a remote Git repository from a local one? 我遵循了此方法如何从本地库创建远程Git库?

and this article 和这篇文章

I am trying to create a local Git repo for team of 3 developers with windows machine . 我正在尝试为3个使用Windows机器的开发人员团队创建一个本地Git存储库。 After spending hours in vain, I am coming here. 花了几个小时徒劳之后,我才来这里。

My Setup: 我的设置:

I used one of my external hardisk (K: drive with share \\\\xyz\\gitRepo ) for shared repo. 我使用了一个外部hardisk(K:具有共享\\\\xyz\\gitRepo驱动器)进行共享存储库。 and C: drive for my local work 和C:开车去当地工作

To test the version control. 测试版本控制。 I created a test file and commited and pushed. 我创建了一个测试文件并提交并推送。

When I do 当我做

git push origin master

I get: 我得到:

Eveything up-to-date

message. 信息。

But when I manually go see remote drive content in folder \\\\xyz\\gitRepo\\myProject , I don't find my new file ever being copied. 但是,当我手动查看文件夹\\\\xyz\\gitRepo\\myProject远程驱动器内容时,我找不到要复制的新文件。

I don't get an error so, don't know what wrong I am doing. 我没有收到任何错误消息,所以我不知道我在做什么错。 Any ideas/suggestions? 有什么想法/建议吗?

If there are any other such free version control software which are less painful to use, please let me know. 如果还有其他这样的免费版本控制软件,它们使用起来不太麻烦,请告诉我。 Thanks! 谢谢!

Update: I get following error, when I did some more fiddling after reading your answers and comments, now I can get something 更新:我收到以下错误消息,当我在阅读您的答案和评论后又做了一些摆弄时,现在我可以得到一些信息

BTW: y:\\ is network map for \\\\xyz\\gitRepo I created as per instruction from article above 顺便说一句: y:\\\\\\xyz\\gitRepo网络映射,我是根据上述文章中的说明创建的

Counting objects: 282, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (242/242), done.
Writing objects: 100% (281/281), 3.21 MiB, done.
Total 281 (delta 160), reused 0 (delta 0)
remote: error: unable to write sha1 filename ./objects/pack/pack-e7e1036deac5f7b032db6445f3071dd014076632.pack: Permissi
on denied
remote: fatal: cannot store pack file
error: unpack failed: index-pack abnormal exit
To file:///y:
 ! [remote rejected] master -> master (unpacker error)
error: failed to push some refs to 'file:///y:'

I don't know why it is trying to write ./objects/pack I thought it should be writing either at \\xyz\\gitRepo\\objects\\pack or y:\\objects\\pack 我不知道为什么要尝试写./objects/pack我认为应该写在\\ xyz \\ gitRepo \\ objects \\ pack或y:\\ objects \\ pack

gitRepo folder has read/write permission to everyone. gitRepo文件夹对所有人都有读/写权限。

I am on windows 8 machine. 我在Windows 8机器上。

If your remote repo is "bare" - it does not have the "work area". 如果您的远程仓库是“裸机”-它没有“工作区”。 This means that your file was committed to repository and stored as object there. 这意味着您的文件已提交到存储库并作为对象存储在那里。

To test if you push actually working check the size of the "objects" directory in remote repo before and after the push. 要测试您是否实际执行推送,请在推送之前和之后检查远程存储库中“对象”目录的大小。 The size should increase if you actually pushed new file. 如果您实际推送了新文件,则大小应增加。

To use Git efficiently you have to gain some understanding on it internals. 为了有效地使用Git,您必须对它的内部知识有所了解。 Here is one of the best sources: http://git-scm.com/book 这是最好的来源之一: http : //git-scm.com/book

As explained above - a bare repo (usually the "remote" repository) does not show any files. 如上所述,裸仓库(通常是“远程”存储库)不会显示任何文件。 If you want to be sure that your file was added you can simple clone your project again and check for the file. 如果要确保已添加文件,则可以再次简单地克隆项目并检查文件。 :-) :-)

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

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