从 git-svn 克隆的远程存储库更新裸 git 存储库
我有一个远程 SVN 存储库 (X),一名自由开发人员正在其中提交他的工作。然而,在我的公司,我们使用 GIT 并使用 git-svn 来互操作 GIT 和 SVN。没关系!
因此,我已将 SVN 存储库 (X) 克隆到 GIT 本地存储库 (A) 中。之后,我将本地 git 存储库 (A) 克隆到本地 GIT 裸存储库 (B),以便能够通过 SSH 从任何地方拉取它。
问题是:每次开发人员提交到他的 SVN 存储库时,我都会执行“git svn fetch && git svn rebase”以获得本地存储库的更新 (A) ,但我无法更新我的本地裸存储库 (B )从A。从B,我运行“git fetch”,所以它从(A)获取更改到FETCH_HEAD,但我想将这些更改“合并”到裸存储库(B) HEAD,以便我可以从远程存储库中提取更改。
有什么想法吗?
我希望我已经说得足够清楚了。谢谢!
I have a remote SVN repository (X) where a freelance developer is committing his work. However, in my company we work with GIT and are using git-svn to interoperate GIT and SVN. That's ok!
So, I've cloned the SVN repository (X) into a GIT local repository (A). After this, I've made a clone of the local git repository (A) into a local GIT bare repository (B) to be able to pull it from everywhere through SSH.
The problem is: everytime the developer commits to his SVN repository, I do "git svn fetch && git svn rebase" in order to get updates local repos (A) , but I can't update my local bare repository (B) from A. From B, I ran "git fetch", so it fetched changes from (A) into FETCH_HEAD, but I want to "merge" these changes to the bare repository (B) HEAD, so that I can pull changes from a remote repos.
Any ideas?
I hope I've been clear enough. Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在 Git 中,合并需要工作副本才能实际执行合并(因为可能存在冲突)。这可能就是您无法在裸存储库 (B) 中合并的原因。
您可以做的是合并到工作存储库 (A),然后将合并结果推送到存储库 (B)。
In Git, merging requires a working copy in order to actually perform the merge (because there might be conflicts). This is probably why you can't merge inside your bare repository (B).
What you can do is merge in your working repository (A), then push the result of the merge to repository (B).
简单的答案 - 您可以从 A 推送到裸存储库 B。
Simple answer - You can push from A to the bare repository B.
您可以将 SubGit 安装到您的存储库 X 中,以便在该计算机上创建一个裸 Git 存储库 (Y),以便同步同步X→Y将自动进行。
因此,您可以使用 Y 代替 B 或通过定期在 B 上运行“git pull --all ”来同步它们。在这种情况下,存储库 A 是多余的。
You may install SubGit into your repository X, so that a bare Git repository (Y) will be created on that machine, so that syhchroinzation X<->Y will be performed automatically.
So you may use Y as a replacement of B or sync them by running "git pull --all " on B periodically. The repository A is redundant in this case.