7

GitLab を Ubuntu サーバーにインストールしました。サーバーとの間でプッシュ/プル/クローンできないことを除いて、すべて正常に動作しているようです。

プッシュすると、一般的なエラー メッセージが表示されます。

fatal: Could not read from remote repository.

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

私は何時間ものグーグルですべてを試しましたが、問題を見つけることができないようです.

sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production

正常に実行されます。ボード全体で OK です。

git@address.adress に SSH で接続できます。

PTY allocation request failed on channel 0
Welcome to GitLab, Anonymous!

私がする時:

ssh git@adress.adress "ls /location/of/git/dir"

私は得る:

Not allowed command

Web サイトが実行されています。サイトにリポジトリを作成すると、/home/git/repository/ に表示されます

しかし、私はまだそれにプッシュすることはできません。

私はこのガイドに従いました:

https://github.com/gitlabhq/gitlabhq/blob/5-0-stable/doc/install/installation.md

そして、Apacheで実行するためのこのガイド:

http://shanetully.com/2012/08/running-gitlab-from-a-subdirectory-on-apache/

4

6 に答える 6

4

以下のコマンドでテストできます。ログインすると、あなたの名前が表示されます。

ssh -T git@myserver.com

クリスチャン・ハマー、GitLab へようこそ!

「GitLab へようこそ、アノニマス!」と表示された場合 gitlab はあなたを gitlab のユーザーとして認識しません。

于 2013-09-27T15:57:18.210 に答える
2

受け入れられた回答についてより正確に言うと(「4月6日17:23に回答」および「7月21日10:07に編集」、「Joakim Engstrom」による):

ほとんどの場合、Gitlab を自分のコンテキスト パスに合わせて更新した状況です (それは からhttp://localhost/<my_context_path>ではなくからアクセスしていhttp://localhostます)。

このためのハウツーでは、この gitlab-shell 構成ファイルを変更することについても言及されていません。

// logout any Gitlab open session, stop your Gitlab service, and your possible third-party webserver first  
$ sudo service apache2 stop  
$ sudo service gitlab stop  

// perform the modification that fixes it, if you indeed configured Gitlab to be accessed with a custom context path  
$ sudo -u git -H nano ~git/gitlab-shell/config.yml  

# Url to gitlab instance. Used for api calls. Should end with a slash.
-gitlab_url: "http://localhost/"
+gitlab_url: "http://localhost/<my_context_path>/"

// restart services  
$ sudo service gitlab start  
$ sudo service apache2 start  

// Try to push again from your particular Gitlab user local repository, to the Gitlab remote repository    
$ cd <path_to_my_local_repository>  
$ sudo -u <OS_username_that_owns_the_local_repository> -H git push -u origin master  
Counting objects: 3202, done.  
Delta compression using up to 2 threads.  
Compressing objects: 100% (3115/3115), done.  
Writing objects: 100% (3202/3202), 11.56 MiB | 5.34 MiB/s, done.  
Total 3202 (delta 609), reused 0 (delta 0)  
To `git@<my_FQDN>:<my_Gitlab_user_or_group_name>/<my_gitlab_project_ID>.git`  
  * [new branch]      master -> master  
Branch master set up to track remote branch master from origin.  
$   

「stackoverflow.com/questions/13071234/… に似ている – Paul Verest 7 月 18 日 6:20」について (新しい gitlab インストールにプッシュできません):
いいえ、これはこのページのトピックと同じ問題ではありません。

于 2013-10-19T17:38:59.727 に答える
0

私の場合、その理由は、nginx による強制的な https へのリダイレクトでした。実行して、git ユーザーが gitlab-api を使用できるかどうかを確認します。

sudo -u git -H /home/git/gitlab-shell/bin/check

サーバー上。私の場合、出力は

Check GitLab API access: FAILED. code: 301

に変更する必要がありgitlab_urlまし/home/git/gitlab-shell/config.ymlhttps://<domain>

于 2015-07-09T17:37:21.383 に答える
0

私にとっては、/etc/ssh/sshd_config AllowUsers git でサーバーに ssh できる人を制限していたためです。

于 2016-05-22T01:51:31.577 に答える