2016-04-25 11 views
3

Dockerを使ってGogsをインストールしました。その後私は(実際にはrepositoryは、などの複数の支店を持っていますが、私は簡単なこの例を維持しています)、このようなローカルリポジトリを作成しました:Gogs Docker ContainerへのローカルGITリポジトリの追加

mkdir repository 
cd repository 
git init 
touch README.md 
git add README.md 
git commmit -m "How do I get this into Gogs" 

どのように私は今Gogsにこれをプッシュする/移行するのですか?

答えて

2

ゴーグにチェンジセットをプッシュするには、ゴーグにレポを作成し、コンテナの開始時に公開されたポートを使用するリモートを追加する必要があります。不明な場合は、以下を実行し、HostPortエントリに注意してください。コンテナはgogsという名前と仮定すると:

docker inspect --format "{{json .HostConfig.PortBindings}}" gogs 

SSHリモートの原点を設定する手順は次のとおり。 3000/tcpのHostPortエントリでアクセスするgogs webを使用して公開鍵を追加します。ゴーグルドッカーの指示に従った場合は、http://localhost:10080ゴーグルがローカルで実行されていない場合は、localhostをゴーグルホスト名に置き換えてください。

より容易に代替のSSHポートを指定する~/.ssh/configに次のホストエントリを追加:

Host gogs 
    # if gogs is not running locally, add the remote hostname here 
    Hostname localhost 
    User git 
    # the following should match what is listed for HostPort 22/tcp 
    port 10022 

テストssh gogsとのSSHホストエントリ。それが動作する場合は、表示されるはずです。

PTY allocation request failed on channel 0 
Hi there, You've successfully authenticated, but Gogs does not provide shell access. 
If this is unexpected, please log in with password and setup Gogs under another user. 
Connection to localhost closed. 

をリモートとして以下を追加します。あなたはgogs SSHホストエントリで[email protected]を交換している

git remote add origin gogs:yourusername/your-repo.git 

注意。

あなたのゴーグル・レポにプッシュできるはずです。

+0

ありがとうございます!当初、いくつかの構成上の問題があったが(https://github.com/gogits/gogs/issues/3019)、これですべてがうまくいった。再度、感謝します! – Ole

+0

私はそれが助けてうれしい! –

関連する問題