在现有 bzr 项目中创建分支
我是一个小项目的唯一开发人员。我用集市运送这个项目。在最初阶段,我做了以下工作:
mkdir myProject
cd myProject
bzr init
bzr mkdir src
bzr mkdir data
bzr mkdir foo
....
我在这个项目上取得了一些进展,并且它已经包含了几十个提交。现在我意识到我需要为这个项目创建分支。类似
trunk
rel
testFeature1
testFeature2
...
完成此任务的最佳方法是什么?
我所做的是:
cd myProject
mkdir repo
mv .bzr repo
mv .bzrignore repo
del src data foo
mkdir trunk
cd trunk
bzr branch ../repo ./ --use-existing-dir
我对结果非常满意,除了在 myProject/repo
内发出的 bzr status
抱怨所有这些丢失的文件这一事实。
现在问问题:我的方法可以接受吗?对于 repo
目录中丢失的文件我该怎么办?
I'm the only developer of a small project. I truck that project with bazaar. At the initial stages I did the following:
mkdir myProject
cd myProject
bzr init
bzr mkdir src
bzr mkdir data
bzr mkdir foo
....
I have had some progress with this project and it already contains couple of dozens of commits. Now I have realized that I need to create branches for this project. Something like
trunk
rel
testFeature1
testFeature2
...
What is the best way to accomplish this?
What I did was:
cd myProject
mkdir repo
mv .bzr repo
mv .bzrignore repo
del src data foo
mkdir trunk
cd trunk
bzr branch ../repo ./ --use-existing-dir
I'm pretty much satisfied with the result, except for the fact that bzr status
issued inside myProject/repo
complains about all those missing files.
Now to the questions: is my approach acceptable? What should I do about the missing files in the repo
directory?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我要做的方法是:从您创建的项目开始:
现在创建一个存储库并将分支推入其中:
现在开始进行签出(轻量级或其他方式,具体取决于您的偏好):
现在,您可以为功能或其他内容创建分支:
并将更改合并回主干:
请注意,bzr switch 采用相对于当前目录、绝对路径或相对于存储库的路径您已链接到存储库,但
bzr merge
需要相对于当前目录或绝对路径(不是相对于存储库)。这可能不适合您的工作流程(结帐等),但它是实现您想要做的事情的相当有效的方法。希望有帮助。
The way I would go about this would be to do this: start with a project like the one you created:
Now create a repository and push the branch into it:
Now start working on a checkout (lightweight or otherwise depending on your preference):
Now you can create branches for features or whatever:
and merge the changes back into trunk:
Note that
bzr switch
takes either a path that is either relative to the current directory, absolute, or relative to the repository when you're linked to a repository, butbzr merge
requires a path that is relative to the current directory or absolute (not relative to the repository).This may not fit your workflow (checkouts and the like), but it is a fairly effective way of achieving what you want to do. Hope it helps.