iWIN 必須被解散!

Weil Jimmer's BlogWeil Jimmer's Blog


[筆記] 解決 Git 錯誤 fatal: repository <http://git-url> not found 的問題

-
更新於 2024-04-21 12:30:13

問題:

最近遇到了一個從沒見過的錯誤,為此特別紀錄一下,明明已經初始化 git 倉庫,卻沒辦法從遠端經由 HTTP 進行 pull、clone、push 等動作。

會出現下面的錯誤:

fatal: repository 'http://xxxxxxx/xxx.git/' not found

但是實際上目錄是有資料的,不論是初始化過的或是直接複製 .git 資料夾都沒辦法正常的 clone 或 push。

解決方法:

直接開門見山,講重點,只是因為伺服端建倉庫時少下一個指令:

git update-server-info

只要下完這個指令後,git 會進行一系列更新或建立索引的動作(建立objects/info/packs),類似於建立一個檔案目錄清單的動作。

之後,從遠端伺服器就可以透過 HTTP clone 下 repo 了。

原由:

其實會發生這個問題的主因在於伺服端不是 Smart HTTP server。

Smart HTTP vs. Dumb HTTP:

  • Smart HTTP: 支援 Git 所有功能的 HTTP 協定實現,例如 git push、git pull 等操作。 需要專門的伺服器軟體,例如 Gitea、GitLab、GitHub 等。
  • Dumb HTTP: 僅支援基本的 HTTP 檔案下載功能,無法進行 git push 等操作。 通常用於簡單的 Git 倉庫發布,例如靜態網站。

Dumb HTTP 只是提供簡單的網頁儲存託管倉庫而已。

By Weil Jimmer


This entry was posted in General, Experience, Git, Note By Weil Jimmer.

About Weil Jimmer

avatar

Hi! Everyone! My name is Weil Jimmer. This is my personal blog. I'm a webmaster of this site. I hope the site will be popular. Now, Let's go! Enjoy gaining more knowledge.
More Details About Me : https://weils.net/profile.php

Leave a Reply

Name*:

Email*:

Website:

Privacy:   

Comment*:

Visitor Count

pop
nonenonenone

Note

支持網路中立性.
Support Net Neutrality.

飽暖思淫欲,饑寒起盜心。

支持臺灣實施無條件基本收入

歡迎前來本站。

Words Quiz


Search

Music

Blogging Journey

4289days

since our first blog post.

The strong do what they can and the weak suffer what they must.

Privacy is your right and ability to be yourself and express yourself without the fear that someone is looking over your shoulder and that you might be punished for being yourself, whatever that may be.

It is quality rather than quantity that matters.

I WANT Internet Freedom.

Reality made most of people lost their childishness.

Justice,Freedom,Knowledge.

Without music life would be a mistake.

Support/Donate

This site also need a little money to maintain operations, not entirely without any cost in the Internet. Your donations will be the best support and power of the site.
MethodBitcoin Address
bitcoin1gtuwCjjVVrNUHPGvW6nsuWGxSwygUv4x
buymeacoffee
Register in linode via invitation link and stay active for three months.Linode

Support The Zeitgeist Movement

The Zeitgeist Movement

The Lie We Live

The Lie We Live

The Questions We Never Ask

The Questions We Never Ask

Man

Man

THE EMPLOYMENT

Man

In The Fall

In The Fall

Facebook is EATING the Internet

Facebook

Categories

Android (7)

Announcement (4)

Arduino (2)

Bash (2)

C (3)

C# (5)

C++ (1)

Experience (52)

Flash (2)

Free (13)

Functions (36)

Games (13)

General (60)

Git (2)

HTML (7)

Java (13)

JS (7)

Mood (24)

NAS (2)

Note (32)

Office (1)

OpenWrt (6)

PHP (9)

Privacy (4)

Product (12)

Python (4)

Software (11)

The Internet (25)

Tools (16)

VB.NET (8)

WebHosting (7)

Wi-Fi (5)

XML (4)