使用类似darcs的工作流程与Git

时间:2013-11-04 00:47:49

标签: git

我花了很多时间使用Darcs,但现在我正在使用一种强加git的工具。我想弄清楚如何使用我的旧工作流程与git。它似乎应该转换为git,但是当我尝试它时会出现一个奇怪的错误。

假设我有一个包含project-repo的“projects”目录。假设我必须在项目中添加功能'foo'。所以我可能会这样做:

darcs clone project-repo project.foo
cd project.foo

然后进行更改并“提交”历史记录:

darcs record

最后将历史合并到主回购中:

darcs push

现在我可以删除project.foo,或保留它,如果它看起来合情合理。

好的,所以我在使用厨师的项目中给了这个:

git clone chef chef.foo
<make changes>
git commit -m "changes message"
git push

但我收到了错误。

Counting objects: 23, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (16/16), done.
Writing objects: 100% (17/17), 2.29 KiB, done.
Total 17 (delta 9), reused 0 (delta 0)
Unpacking objects: 100% (17/17), 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 /home/foo/dev/chef
! [remote rejected] master -> master (branch is currently checked out)

好吧,我猜这个错误不是特别奇怪,但为什么不“只是工作”?我知道,我可以将它用作分布式vcs吗?

1 个答案:

答案 0 :(得分:0)

好的,我刚试过这个:

cd ..
cd project-repo
git pull ../project.foo

它成功地拉了补丁。如果我可以把东西推进回购,那应该会很好,但是......