gpt4 book ai didi

svn - 使用 svn 元数据克隆 git-svn 存储库

转载 作者:IT王子 更新时间:2023-10-29 01:12:54 28 4
gpt4 key购买 nike

我已经使用 git-svn clone svn://url/trunk --stdlayout 克隆了我的主存储库。现在我想用 svn 元数据克隆存储库。这样我就可以git-svn rebase它到主服务器。

请注意,我不想在两个 git-svn 克隆之间推送提交,我只是想将所有 git-svn 元数据添加到新克隆的存储库, 这样新的克隆也将能够与主颠覆服务器通信。

最佳答案

它在 docs 中.你应该做的是:

git config --replace-all remote.origin.fetch '+refs/remotes/*:refs/remotes/*'
git fetch

获取 svn 元分支。然后你将能够 git-svn rebase 而无需从头开始获取所有内容。


引用自文档:

The initial git svn clone can be quite time-consuming (especially for large Subversion repositories). If multiple people (or one person with multiple machines) want to use git svn to interact with the same Subversion repository, you can do the initial git svn clone to a repository on a server and have each person clone that repository with git clone:

# Do the initial import on a server
ssh server "cd /pub && git svn clone http://svn.example.com/project
# Clone locally - make sure the refs/remotes/ space matches the server
mkdir project
cd project
git init
git remote add origin server:/pub/project
git config --replace-all remote.origin.fetch '+refs/remotes/*:refs/remotes/*'
git fetch
# Prevent fetch/pull from remote git server in the future,
# we only want to use git svn for future updates
git config --remove-section remote.origin
# Create a local branch from one of the branches just fetched
git checkout -b master FETCH_HEAD
# Initialize 'git svn' locally (be sure to use the same URL and -T/-b/-t options as were used on server)
git svn init http://svn.example.com/project
# Pull the latest changes from Subversion
git svn rebase

关于svn - 使用 svn 元数据克隆 git-svn 存储库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5339838/

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