簡體   English   中英

Windows上的Git-無法使用本地(文件)協議推送到遠程存儲庫

[英]Git on windows - cannot push to remote repository using the local (file) protocol

我在Windows 7 Enterprise SP1 x64上使用Git版本1.9.2-preview20140411。

當我嘗試使用本地(文件)協議推送到遠程存儲庫時,出現錯誤:

致命:'orgin'似乎不是git存儲庫致命:無法從遠程存儲庫讀取。

以下是重現步驟:

$ cat PushTestCase.sh
#!/bin/bash
set -o xtrace

cd /C/work/Git
git init --bare MyProjectBare
git clone MyProjectBare MyProjectClone
cd MyProjectClone
echo "apples, oranges" > fruit.txt
git add fruit.txt
git commit -a -m "First commit"
git push orgin master
git remote -v
git remote show orgin

$ PushTestCase.sh
+ cd /C/work/Git
+ git init --bare MyProjectBare
Initialized empty Git repository in c:/work/Git/MyProjectBare/
+ git clone MyProjectBare MyProjectClone
Cloning into 'MyProjectClone'...
warning: You appear to have cloned an empty repository.
done.
+ cd MyProjectClone
+ echo 'apples, oranges'
+ git add fruit.txt
warning: LF will be replaced by CRLF in fruit.txt.
The file will have its original line endings in your working directory.
+ git commit -a -m 'First commit'
warning: LF will be replaced by CRLF in fruit.txt.
The file will have its original line endings in your working directory.
[master (root-commit) 74ee22d] First commit
warning: LF will be replaced by CRLF in fruit.txt.
The file will have its original line endings in your working directory.
 1 file changed, 1 insertion(+)
 create mode 100644 fruit.txt
+ git push orgin master
fatal: 'orgin' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
+ git remote -v
origin  c:/work/Git/MyProjectBare (fetch)
origin  c:/work/Git/MyProjectBare (push)
+ git remote show orgin
fatal: 'orgin' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

$

最初,我是使用網絡驅動器上的遠程存儲庫來嘗試此操作的。 為了消除任何可能的權限問題,我使用本地驅動器上的遠程存儲庫重現了該問題。

我知道另一種選擇是在服務器上設置SSH,但我寧願使用本地協議來使其工作。

您的腳本有錯字。 正確:

git push orgin master

至:

git push origin master

暫無
暫無

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

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