git工作流程模型&分枝

发布于 2025-01-05 04:21:55 字数 263 浏览 1 评论 0原文

我有这个有趣的链接 http://nvie.com/posts/a -成功-git-分支-模型/ 所以我对此有疑问:

如何初始化“origin”存储库(裸)或工作分支?

你什么时候进行最终整合?如果来源是一个裸仓库,那么我需要在本地分支上执行此操作,然后将其推送到公共(裸)仓库?

此致, 彼得

I've got this interesting link http://nvie.com/posts/a-successful-git-branching-model/
So I have question regarding it:

How to initialize "origin" repo (as bare) or working branch?

When do you do final integration? If the origin is a bare repo then I need to do it on local branch then push it to public(bare) repo?

Best regards,
Peter

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

英雄似剑 2025-01-12 04:21:55

如果您打算将其用作服务器,那么它应该是裸露的。因此您可以从那里推送和拉取更改和分支。

如果它不是裸露的,您将收到这样的消息,解释为什么它应该是裸露的:

  Counting objects: 3, done.
  Delta compression using up to 2 threads.
  Compressing objects: 100% (2/2), done.
  Writing objects: 100% (2/2), 239 bytes, done.
  Total 2 (delta 0), reused 0 (delta 0)
  Unpacking objects: 100% (2/2), 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 /Users/flores/Code/git-test
   ! [remote rejected] master -> master (branch is currently checked out)
  error: failed to push some refs to '/Users/flores/Code/git-test'

If you intend to use it as server it should be Bare. So you can push and pull changes and branches from there.

If it is not bare, you would receive a message like this, explaining why it should be bare:

  Counting objects: 3, done.
  Delta compression using up to 2 threads.
  Compressing objects: 100% (2/2), done.
  Writing objects: 100% (2/2), 239 bytes, done.
  Total 2 (delta 0), reused 0 (delta 0)
  Unpacking objects: 100% (2/2), 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 /Users/flores/Code/git-test
   ! [remote rejected] master -> master (branch is currently checked out)
  error: failed to push some refs to '/Users/flores/Code/git-test'
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文