2011-02-04 6 views
1

OK私は自分のマシンにリポジトリセットアップがあり、これを使用してファイルサーバー上の場所に更新をプッシュしたいと考えています。GITを使用してローカルファイルサーバー上のファイルを更新する

がマシンにDIR以降:私はクローンを作成するには、次のように使用

git init 
git add . 
git commit -m 'initial' 
cd ../ 

次にこれは罰金クローンをどのように私は更新するために、GITを使用することができますファイルサーバ

git clone -bare testdir fileserverip/testdir 

にクローニング?これまでのGITでの私の経験とは異なり、SSHなどで接続するつもりはないので、どのようにプッシュアップを設定できますか?

EDIT:

Makisでの回答で述べたように、私のセットアップを変更した後、私はこれが何を意味するのか誰もが知っているgit push

james-macbook:test2 james$ git push 
Counting objects: 6, done. 
Delta compression using up to 2 threads. 
Compressing objects: 100% (4/4), done. 
Writing objects: 100% (4/4), 506 bytes, done. 
Total 4 (delta 1), reused 0 (delta 0) 
Unpacking objects: 100% (4/4), done. 
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 xxxxxxxxxxxxxxxxxxx 
! [remote rejected] master -> master (branch is currently checked out) 
error: failed to push some refs to 'xxxxxxxxxxxxxxxxxxx' 
james-macbook:test2 james$ 

上で次のエラーを取得しますか?

EDIT:ちょうどこれが見つかった、それは私が必要と思うものだと思う。 http://tiredblogger.wordpress.com/2009/11/09/creating-local-git-repositories-yeah-its-that-simple/

おかげ

+0

ちょうどこれがServerFaultでより適切かもしれないと思った。わからない? –

+0

あなたのリモートレポが裸ではないように見えます。 – Makis

答えて

1

あなたは、NFSやSambaの、簡単peasyを介してサーバのディレクトリをマウントすることができます。私は最初にサーバー上の裸のリポジトリを作成していたでしょう。その後、あなたのマシン上の空のリポジトリをクローンし、それらを追加します。

その後、すべて正常(プッシュ、プッシュ)のように動作します。

+0

ねえ、ありがとう。 –

+0

プルとプッシュがファイルの削除や名前の変更を更新しないように思われる理由はありますか? git statusはそれがプッシュであると言っていますが、プルダウンすると、名前が変更されたファイルがプルされ、古いものも保持されます:/ –

+0

git rmを使用してgit addではなくリポジトリからファイルを削除する必要があります。 – Makis

0

gitリポジトリにプッシュしてWebサイトを展開するというよくある質問とよく似たことをしようとしているようですが、その方法についての情報も同様にこの状況に当てはまるはずです。 Webページは、(FYIコマンドで、あなたがあなたの代わりにあなたが遭遇された1つの問題である可能性があり--bare-bareを持っていた上記の)裸のリポジトリを設定し、更新するために、ポスト受けるフックを使用して記述すること

http://toroid.org/ams/git-website-howto

自動的にディレクトリの内容。ポスト受信フックは、git checkout -fを呼び出すことによってこれを行いますが、明示的な作業ツリーが指定されています(裸のリポジトリには作業ツリーがないため、通常はコマンドが失敗します)。

+0

ありがとう、私は実際に言います - しかし、私はそれが最後に働いています。ありがとう。 –

関連する問題