SSH上のプライベートサーバー上のワークフローのようなGitHub
-
02-10-2019 - |
質問
インターネット上のサーバー(SSH経由で利用可能)があり、友人とプロジェクトの作業に使用しています。ソースコントロールにGitを使用し始めました。現在、セットアップは次のとおりです。
- 友人はリポジトリを作成しました
server
とgit --bare init
名前が付けられましたproject.friend.git
- 私はクローンしました
project.friend.git
の上server
にproject.jesse.git
- それから私はクローンしました
project.jesse.git
の上server
私の地元のマシンに使用していますgit clone jesse@server:/git_repos/project.jesse.git
- 私は地元のマシンで作業し、ローカルマシンにコミットしています。変更をプッシュしたいとき
project.jesse.git
の上server
私が使うgit push origin master
. 。私の友人は取り組んでいますproject.friend.git
. 。私が彼の変更を取得したいとき、私はしますpull jesse@server:/git_repos/project.friend.git
.
すべてが正常に動作しているようですが、私は今、私がそうするときに次のエラーを取得しています git push origin master
:
localpc:project.jesse jesse$ git push origin master
Counting objects: 100, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (76/76), done.
Writing objects: 100% (76/76), 15.98 KiB, done.
Total 76 (delta 50), reused 0 (delta 0)
warning: updating the current branch
warning: Updating the currently checked out branch may cause confusion,
warning: as the index and work tree do not reflect changes that are in HEAD.
warning: As a result, you may see the changes you just pushed into it
warning: reverted when you run 'git diff' over there, and you may want
warning: to run 'git reset --hard' before starting to work to recover.
warning:
warning: You can set 'receive.denyCurrentBranch' configuration variable to
warning: 'refuse' in the remote repository to forbid pushing into its
warning: current branch.
warning: To allow pushing into the current branch, you can set it to 'ignore';
warning: but this is not recommended unless you arranged to update its work
warning: tree to match what you pushed in some other way.
warning:
warning: To squelch this message, you can set it to 'warn'.
warning:
warning: Note that the default will change in a future version of git
warning: to refuse updating the current branch unless you have the
warning: configuration variable set to either 'ignore' or 'warn'.
To jesse@server:/git_repos/project.jesse.git
c455cb7..e9ec677 master -> master
この警告は私が心配する必要があるものは何でもありますか?私が言ったように、すべてが機能しているようです。私の友人は私の枝から私の変更を引き出すことができます。私はサーバーにクローンを持っているので、彼は私のローカルマシンにアクセスできないので彼がそれにアクセスできるようにします。より良いことができることはありますか?
ありがとう!
解決
aを設定する必要があります 裸 サーバー上のリポジトリ。ベアリポジトリには、通常にあるバージョン履歴情報のみが含まれています .git
リポジトリルートのディレクトリ。あなたはそれからクローンするか、他のリポジトリと同じようにそれにプッシュすることができます。
ベアリポジトリはで作成されます
git init --bare
すでにいくつかのバージョンの履歴がある場合は、裸のクローンを作ります
git clone --bare git://some/where
あなたの警告については、参照してください この質問.
所属していません StackOverflow