3
我想有以下git的工作流程,git的工作流程的笔记本电脑,台式机,github上
github
/ \
laptop-----desktop
的想法是,桌面保持与笔记本电脑同步,并推向github上发生何时何地,无论从计算机。
由于我的笔记本电脑不是永久在线,我需要一种方法从笔记本电脑拉到桌面。在笔记本电脑上,我克隆了github repo,然后创建了一个远程桌面。然后我建立了一个跟踪分支(在笔记本电脑上)来跟踪桌面上的分支“开发”。
> git branch --track develop desktop/develop
我对笔记本电脑上的分支'develop'进行了更改,并尝试将其推送到我获得的桌面。
>git push desktop
...
remote: error: refusing to update checked out branch: refs/heads/develop
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 t
remote: error: 'ignore' or 'warn' in the remote repository to allow pushing int
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 som
remote: error: other way.
remote: error:
remote: error: To squelch this message and still keep the default behaviour, se
remote: error: 'receive.denyCurrentBranch' configuration variable to 'refuse'.
To ssh:// ....
! [remote rejected] develop -> develop (branch is currently checked out)
我读了一些关于错误,它听起来像recomended要做的是从桌面上拉,而不是从笔记本电脑推,但这不是一个选项。
为什么不将更改推送到github并下拉到另一台机器上? – grossvogel 2012-02-05 15:14:01
这是目前的工作,但我认为这个工作流应该可以用git。 – alex 2012-02-05 16:04:30