2016-10-29 69 views
0

我有一個在git中設置的項目。我正在嘗試在onedrive中創建一個存儲庫,但我無法讓git在創建後識別該存儲庫。在onedrive git遠程無法識別

我在onedrive中創建了文件夾,刪除了一箇舊的原點並添加了新的原點。所有這一切都很順利,直到我試圖查詢它或執行任何操作(例如推送),並且我只是得到'無法從遠程存儲庫讀取'錯誤。請參閱代碼。

奇怪的是,git非常高興地創建遠程,但然後無法訪問它。

這裏是過程和代碼

PS E:\ToolTrakka V7_git\tt> md C:\users\rgudgeon.RGA\OneDrive\Development\tooltrakka_v7_repo.git 


Directory: C:\users\rgudgeon.RGA\OneDrive\Development 


Mode    LastWriteTime   Length Name                     
----    -------------   ------ ----                     
d-----  30-Oct-16 10:08 AM     tooltrakka_v7_repo.git                



PS E:\ToolTrakka V7_git\tt> cd C:\users\rgudgeon.RGA\OneDrive\Development\tooltrakka_v7_repo.git 

PS C:\users\rgudgeon.RGA\OneDrive\Development\tooltrakka_v7_repo.git> git init --bare 
Initialized empty Git repository in C:/Users/rgudgeon.RGA/OneDrive/Development/tooltrakka_v7_repo.git/ 

PS C:\users\rgudgeon.RGA\OneDrive\Development\tooltrakka_v7_repo.git> cd "E:\ToolTrakka V7_git\tt" 

PS E:\ToolTrakka V7_git\tt> git remote 


PS E:\ToolTrakka V7_git\tt> git remote add origin file:\\\C:\users\rgudgeon.RGA\OneDrive\Development\tooltrakka_v7_repo.git 

PS E:\ToolTrakka V7_git\tt> git remote 
origin 

E:\ToolTrakka V7_git\tt> git remote show origin 
git : ssh: Could not resolve hostname file: Name or service not known 
At line:1 char:1 
+ git remote show origin 
+ ~~~~~~~~~~~~~~~~~~~~~~ 
    + CategoryInfo   : NotSpecified: (ssh: Could not ...rvice not known:String) [], RemoteException 
    + FullyQualifiedErrorId : NativeCommandError 

fatal: Could not read from remote repository. 
Please make sure you have the correct access rights 
and the repository exists. 

PS E:\ToolTrakka V7_git\tt> 

PS E:\ToolTrakka V7_git\tt> git push -u origin master 
git : ssh: Could not resolve hostname file: Name or service not known 
At line:1 char:1 
+ git push -u origin master 
+ ~~~~~~~~~~~~~~~~~~~~~~~~~ 
+ CategoryInfo   : NotSpecified: (ssh: Could not ...rvice not known:String) [], RemoteException 
+ FullyQualifiedErrorId : NativeCommandError 

fatal: Could not read from remote repository. 
Please make sure you have the correct access rights 
and the repository exists. 

有沒有人有這個重新任何想法?

問候雷

回答

1

首先,git remote add name url只是增加(name, url)一雙混帳配置,也沒有驗證。所以無論你給git remote add,它總是愉快地創建遙控器。

其次,ssh: Could not resolve hostname file: Name or service not known顯示git將您的來源視爲ssh協議。嘗試將file:\\\更改爲file:///

+0

感謝,似乎已經修復它。有時候,這是最簡單的事情。 – user3247506