Windows Git存储库未更新
背景:Windows Git存储库未更新,windows,git,ubuntu,Windows,Git,Ubuntu,背景: 在一个网络中,有两台电脑,一台使用Windows7,另一台使用Ubuntu12.10作为操作系统 两者都安装了Git。Windows one from和Ubuntu one fromapt get install git core Ubuntu PC配置了Samba,因此可以使用其主机名访问网络中的Windows PC 使用git克隆http://windowspc/system/.git,可以从Ubuntu PC中的Windows PC创建存储库的克隆 问题: 在Windows
- 在一个网络中,有两台电脑,一台使用Windows7,另一台使用Ubuntu12.10作为操作系统
- 两者都安装了Git。Windows one from和Ubuntu one from
apt get install git core
- Ubuntu PC配置了Samba,因此可以使用其主机名访问网络中的Windows PC
- 使用
,可以从Ubuntu PC中的Windows PC创建存储库的克隆git克隆http://windowspc/system/.git
- 在Windows PC中对代码进行更改。命令
和git add.
在Windows PC的git提示符中发出git commit-m“Comment.
- 回到Ubuntu PC,当出现
和git fetch
命令时,会显示消息git pull
已经是最新的
- 但是,在Windows PC中所做的任何更改都不会出现在Ubuntu PC中
- 从Windows PC到Ubuntu PC更新文件的路径应该是什么
cd /cygdrive/c/source
git clone --bare --no-hardlinks -l . /cygdrive/s/shareddir/source.git
要将新的裸存储库连接回原始源代码,请执行以下操作:
cd /cygdrive/c/source
git remote add origin /cygdrive/s/shareddir/source.git
git remote update
git remote -v
git branch --set-upstream master origin/master
尝试克隆
http://windowspc/system
(没有.git
)@VonC:我试过了。但它至少赢得了克隆,更不用说更新了。要制作一个克隆,我们必须使用.git
。两个存储库的分支是否相同?@rlegendi:Ubuntu PC中的存储库是Windows PC中的存储库的克隆。两个存储库只有一个分支(我仍在尝试设置),即“主”。您确定没有使用硬链接,因为所有存储库实际上都是指向同一git存储库的链接。确保克隆时没有硬链接。如果这有帮助,请分离您的存储库,这样您就有了一个核心裸存储库,因为它更灵活。(见下面我的答案)。