0

私のラップトップには Git リポジトリがあり、サーバーは遠く離れています。

サーバーでこれを行いました:

$ cd apps
$ mkdir my_beautiful_app
$ git init --bare

私のラップトップでは、これを行いました:

$ cd beautiful_app_dir
$ git remote add website my_user@11.22.33.44:apps/my_beautiful_app
$ git push website master

何かを転送しているように見えたので、これは機能していると思いました。しかし、実際にはそうではありません。サーバーのmy_beautiful_appディレクトリに、プロジェクトのファイルの痕跡がありません。そして今、求めていないファイルとディレクトリがたくさんあります。

サーバー上:

$ ls ~/apps/my_beautiful_app
branches  config  description  HEAD  hooks  info  objects  refs

まあ、それは予想外です。この奇妙な動作が発生するのはなぜですか? サーバー上のディレクトリをローカル ディレクトリと同期するにはどうすればよいですか?

編集:

OK、同じことを試しましたが、--bareオプションはありませんでした。これが私が得たものです:

$ git push website master
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'.
4

1 に答える 1