簡體   English   中英

Git 從服務器克隆/拉取問題

[英]Git clone/pull issues from server

我有一個稍微復雜的問題,可以分為兩個工作環境:

  1. 我的Windows 10 工作電腦
  2. Linux 服務器,可通過 SSH、VNC 和使用 VPN 的聯網 SAMBA 驅動器訪問

服務器上有兩個 git repos:

  1. 一個存檔的共享倉庫,位於 //xxx.xxx.xxx.xxx/repos/git-matlab/
  2. 我的個人倉庫,位於 //xxx.xxx.xxx.xxx/my-username/repos/personal-repo/

我已經在兩個系統上設置了我的 SSH 密鑰(它們存在於 ~/.ssh 中)。

我已經能夠從我的 Windows 機器上推送、拉取和克隆到個人倉庫,沒有任何問題。

嘗試從我的 Windows 機器克隆到 git-matlab 時,出現以下錯誤:

$ git clone --branch=main //xxx.xxx.xxx.xxx/repos/git-matlab/
Cloning into 'git-matlab'...
error: refs/heads/main does not point to a valid object!
fatal: Remote branch main not found in upstream origin

嘗試使用 PuTTY 從服務器上的個人 Linux 環境克隆到 git-matlab 時,出現大錯誤。 Output總結如下:

$ git clone --branch=main /home/repos/git-matlab/

...

warning: failed to stat /home/repos/git-matlab/.git/objects/a5/1396ecd11cf0fd93cedd0dff1deda885508e3d

warning: failed to stat /home/repos/git-matlab/.git/objects/a5/f60d21cf9955ab0b6c82c12fefaa9e1f51dfc0

warning: failed to stat /home/repos/git-matlab/.git/objects/f3/.

warning: failed to stat /home/repos/git-matlab/.git/objects/f3/..

warning: failed to stat /home/repos/git-matlab/.git/objects/f3/4fd030aeee62a14e915e1fe06d2a7a22e2595e

warning: failed to stat /home/repos/git-matlab/.git/objects/f9/.

warning: failed to stat /home/repos/git-matlab/.git/objects/f9/..

warning: failed to stat /home/repos/git-matlab/.git/objects/f9/7e571b07827b8e32be70c38191cae18e3295b9

done.

一個帶有 .git 目錄的 git-matlab 文件夾會被輸出,但僅此而已。

我應該補充一點,這些都是共享存儲庫。 我也有權通過 Windows Explorer 和 Nautilus(Linux 文件資源管理器)查看 git-matlab 目錄。

任何幫助或見解將不勝感激。 提前致謝。

首先,確保使用最新的 Git 對於 Windows ,考慮到對 UNC 路徑的支持在 2019 年第四季度得到了改進

二、如果服務器可以通過SSH訪問,那么試試那個協議

git clone ssh://remoteUSer@xxx.xxx.xxx.xxx/full/path/to/repo

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM