簡體   English   中英

如何將現有的裸git存儲庫導入Gitlab?

[英]How to import an existing bare git repository into Gitlab?

導入我的裸git倉庫到Gitlab被描述為在這里 ,因為它不被視為一個git倉庫,而是創建了一個94K的大“空”回購(原來是2,8GB大):

$ bundle exec rake gitlab:import:repos RAILS_ENV=production
fatal: Not a git repository (or any of the parent directories): .git
Processing test.git
INFO: Sidekiq client using redis://localhost:6379 with options:namespace=>"resque:gitlab"}
 * Created test (test.git)
Done!

作為一種解決方法,我用我的裸倉庫替換空項目文件夾(由導入試用版創建)。 然后我樹從克隆遠程克隆repo並得到以下錯誤:

$ git clone git@mydomain.com:...test.git
Cloning into 'test'
fatal: '...test.git' 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用戶應該擁有所需的所有權限。 - 也許我有一些被忽視的東西?

我的系統:RHEL6.3,Git 1.8.3.4,Gitlab5.3。

Gitlab需要一個普通的存儲庫(非裸)嗎? 或者我的問題是什么?

Gitlab需要一個普通的存儲庫(非裸)嗎?

不,由gitlab管理的所有回購都是裸回購。

你應該看到:

/home/git/repositories/user1/repo1.git
/home/git/repositories/user1/repo2.git
/home/git/repositories/greoup1/repo3.git
...

確保test.git文件夾(以及其中的裸存儲文件)的權限與/home/git/repositories/下的現有裸/home/git/repositories/

如果導入不起作用,那么“用我的裸倉庫替換空項目文件夾(由導入試驗創建)”應該。

但是:你需要確保GitLab創建的空裸~git/repositories/arepo.git/hooks中的任何鈎子(在~git/repositories/arepo.git/hooks )被復制到你的完整裸~git/repositories/arepo.git/hooks替換空~git/repositories/arepo.git/hooks (同一路徑)。
檢查~git/repositories/arepo.git/info~git/repositories/arepo.git/config

要進行調試,首先嘗試克隆導入失敗期間由GitLab創建的空裸存儲庫。
然后用自己的替換它,仔細檢查鈎子然后再試一次。


至於提到的OP和GitLab記錄“ 故障排除指南 ”,正確的SSH網址是:

git@git.myserver.com:repositories/mygroup/proj1.git

with :repositories提到的:repositories


導入裸存儲庫(如下面Sytse Sijbrandijraketasks/import.md

  • 在git repos_path下復制你的裸存儲庫(參見config/gitlab.yml gitlab_shell -> repos_path
  • 運行以下命令

     bundle exec rake gitlab:import:repos RAILS_ENV=production 

對我來說,復制存儲庫的位置是 - / var / opt / gitlab / git-data / repositories

我在上面的dir中復制了我現有的裸存儲庫並運行> gitlab-rake gitlab:import:repos it working !!!

我有它! 這是我的ssh路徑中缺少的目錄。 此問題已在此處進行了跟蹤。

對不起,但錯誤信息並不那么明顯。 我希望這可以幫助像我這樣的其他Gitlab初學者:)

暫無
暫無

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

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