0

リモート Web サーバーに GIT リポジトリをセットアップし、それを Eclipse のプロジェクトに接続しようとしていますが、実行中に問題が発生しました。私は宿題をやり、できる限りのことを試みましたが、現在は行き詰まっています。

リモートサーバーにリポジトリを作成しました。ローカル コンピューターにリポジトリを作成しました。ローカル コンピューターのリポジトリに接続されたプロジェクトが作成されました。両方のリポジトリを接続するためにすべての方法を試しました。不可能。

はい、それは私が試した方法の1つでした。
リモートサーバーに git リポジトリを作成しました。
次に、プロジェクトをインポートし、リポジトリに接続するためのサーバー情報を提供しました。
接続でき、サーバーからのすべてのファイルがプロジェクトに提供されました。
ファイルに変更を加えてから、「チーム > ステージ > コミット > プッシュ」に移動しました。
このエラーが発生しました 'remote: error: refusing to update checked out branch: refs/heads/master

remote: error: By default, updating the current branch in a non-bare repository
remote: error: is denied, because it will make the index and work tree inconsistent
remote: error: with what you pushed, and will require 'git reset --hard' to match
remote: error: the work tree to HEAD.
remote: error: 
remote: error: You can set 'receive.denyCurrentBranch' configuration variable to
remote: error: 'ignore' or 'warn' in the remote repository to allow pushing into
remote: error: its current branch; however, this is not recommended unless you
remote: error: arranged to update its work tree to match what you pushed in some
remote: error: other way.
remote: error: 
remote: error: To squelch this message and still keep the default behaviour, set
remote: error: 'receive.denyCurrentBranch' configuration variable to 'refuse'.
To ssh://sofiane@50.63.180.135/var/www/html/lms
 ! [remote rejected] master -> master (branch is currently checked out)
error: failed to push some refs to 'ssh://sofiane@50.63.180.135/var/www/html/lms'

約8時間後、私は完全にオタクの怒りに陥り、キーボードを壁にぶつけました。人気のあるバージョン管理ツールを導入するには、なんと素晴らしい方法でしょう。

これは私の欲求不満を完全に示しています。Git で地獄へ。こんにちは転覆、私はあなたがいなくて寂しいです。

4

2 に答える 2

1

サーバー上に非ベアとしてリポジトリを作成したと思います。そのため、チェックアウトされている同じブランチにプッシュすることはできません。

サーバー上のリポジトリを確認します。

$ ls
repository

今どちらか:

$ ls -a repository
.git
file1
file2
..

また:

$ ls -a repository
HEAD
config
description
hooks
info
objects
packed-refs
refs

最初の結果が得られた場合は、ベア以外のリポジトリがあります。サーバー上でベアとしてクローンします。

$ ls
repository
$ git clone --bare repository repository.git
$ mv repository oldrepository

次に、それにプッシュしてみてください。.git拡張子は、ベアリポジトリを示す規則であり、リポジトリのURLには必要ありません。これは、ローカルgitリポジトリが古いリモート構成で動作する必要があることを意味します。

于 2012-08-16T18:33:51.413 に答える
0

GITリポジトリビューに何が表示されますか?File -> Import... -> Projects from GitそこにGITリポジトリが表示されている場合は、次のように表示できるはずです。

ここに画像の説明を入力してください

于 2012-08-16T13:19:17.793 に答える