我有一臺服務器(通過ssh)在互聯網上,我的朋友和我一起使用的項目。我們已經開始使用git進行源代碼管理。我們的設置目前如下:github像私人服務器上的工作流程ssh
- 朋友創建存儲庫上
server
與git --bare init
命名project.friend.git
- 我使用
git clone [email protected]:/git_repos/project.jesse.git
- 上
server
克隆project.friend.git
到project.jesse.git
- 然後我就
server
克隆project.jesse.git
到我的本地機器我在本地機器上工作並提交給本地機器。當我想將我的更改推送到時,我使用git push origin master
。我的朋友正在研究project.friend.git
。當我想要得到他的改變時,我做了pull [email protected]:/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 [email protected]:/git_repos/project.jesse.git
c455cb7..e9ec677 master -> master
這是警告什麼我需要擔心什麼?就像我說的,一切似乎都在起作用。我的朋友能夠從我的分支中提取我的更改。我有服務器上的克隆,所以他可以訪問它,因爲他無法訪問我的本地計算機。有什麼可以做得更好嗎?
謝謝!
你確定你的'master'指向'project.jesse.git'嗎? – 2010-04-30 03:57:34
@matt b,因爲我發給主人的改變不會出現在project.friend.git中,直到他把他們拉進自己爲止。 – 2010-04-30 04:07:15