0
私はこれを昨日尋ねましたが、私の質問を正しくしなかったので、誰も助けなかったのです。だから私はもう一度やり直します。ローカルからのアクセス後にリモートサーバーが先に進んでいます
私は、与える私はGitのチェックアウトを追加し、私は、サーバーに私のフックをセットアップし、私のウェブサーバとgitのクローン
git clone [email protected]:user/test.git
cd test
にsshをレポ
mkdir test
cd test
git init
git remote add origin [email protected]:user/test.git
git add .
git commit -m "initial"
git push origin master
を追加ファイルへのアクセス許可
git config receive.denyCurrentBranch ignore
vim .git/hooks/post-recieve
GIT_WORK_TREE=../ git checkout -f
chmod +x .git/hooks/post-recieve
サーバーの認証キーにsshを追加します。
私はその後、私は、ファイルを追加
test [email protected]:test (fetch)
test [email protected]:test (push)
origin [email protected]:user/test.git (fetch)
origin [email protected]:user/test.git (push)
を取得gitのリモート-v上のローカル
git remote add test [email protected]:test
から私のリモートサーバーを追加
touch test.php
git add test.php
git commit -m "test page"
git push origin master
LSは私が取得のみ-lとき
私は、サーバー、サーバーで
git push test master
にプッシュ私はGitのステータスを行うと、私はその後、
# On branch master
# Your branch is ahead of 'origin/master' by 1 commit.
# (use "git push" to publish your local commits)
#
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# deleted: test.php
#
を持ってもらうのindex.php 一つのファイルgit stashを実行してすべてのファイルを取得します。
したがって、ヘッドは正しい位置にあります。それは、test.phpファイルをretrivedだが、それを削除?