gpt4 book ai didi

svn - Subversion : Can I checkout, 修改,然后将其设为分支?

转载 作者:行者123 更新时间:2023-12-03 05:13:33 26 4
gpt4 key购买 nike

我从我的主干到本地 DIR 进行了结帐,并在那里进行了很多本地更改。现在我不想将其提交回主干,但我宁愿从这个本地版本创建一个分支。这可能吗?

我可以将主干复制到分支,然后将 cd DIRsvn switch 复制到分支吗?

更新:感谢您的回答,它成功了!总结一下步骤:

  • cd DIR
  • svn 复制。新分支 URL
  • svn switch new-branch-URL 。

(注意点)

最佳答案

SVN 手册 ( http://svnbook.red-bean.com/en/1.6/svn-book.html#svn.branchmerge.using.create ) 不建议从本地工作副本创建分支。

While it's also possible to create a branch by using svn copy to duplicate a directory within the working copy, this technique isn't recommended. It can be quite slow, in fact! Copying a directory on the client side is a linear-time operation, in that it actually has to duplicate every file and subdirectory within that working copy directory on the local disk.

相反,请先创建分支,然后使用 svn switch 命令,以便您可以提交更改。如果您的工作副本与主干相比明显过时,请将“@REV”附加到源 URL,其中“REV”是 svn info 报告的工作副本的修订版本。

Copying a directory on the server, however, is a constant-time operation, and it's the way most people create branches.

$ svn copy http://svn.example.com/repos/calc/trunk \
http://svn.example.com/repos/calc/branches/my-calc-branch \
-m "Creating a private branch of /calc/trunk."

关于svn - Subversion : Can I checkout, 修改,然后将其设为分支?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1308791/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com