gpt4 book ai didi

xcode - 将 git 与 svn 一起使用的好习惯

转载 作者:IT王子 更新时间:2023-10-29 00:37:47 29 4
gpt4 key购买 nike

几年前Subversion很流行,现在git开始流行,越来越多的人想用git代替Subversion。

问题是很多项目都是基于 Subversion 的。所以问题是如何将 git 与 Subversion 一起使用。不要完全替换svn,使用git。

我能想到的最简单的方法是根据您已经 checkout 的 Subversion 分支代码创建 git。然后在本地用git控制。修改后,提交到本地git服务器,然后用Subversion check out 到远程服务器。 Subversion 就像容器一样包含 git。

顺便说一句,我正在用 xcode 3.x 编码,之前尝试过 xcode 4,但很失望。 (Xcode 4已经出来了,还没有重试)

你怎么看?或者有更好的选择吗?

谢谢

最佳答案

Subversion is just like container to contain git

请务必阅读 git-svn 附带的注意事项部分:

注意事项

For the sake of simplicity and interoperating with a less-capable system (SVN), it is recommended that all git svn users clone, fetch and dcommit directly from the SVN server, and avoid all git clone/pull/merge/push operations between git repositories and branches.
The recommended method of exchanging code between git branches and users is git format-patch and git am, or just 'dcommit’ing to the SVN repository.

Running git merge or git pull is NOT recommended on a branch you plan to dcommit from.
Subversion does not represent merges in any reasonable or useful fashion; so users using Subversion cannot see any merges you’ve made. Furthermore, if you merge or pull from a git branch that is a mirror of an SVN branch, dcommit may commit to the wrong branch.

所以你可以采用任何 merge 和publication使用 Git 的工作流程,只要您保留单独镜像的 SVN 分支(就 merge 或 rebase 而言)。

关于xcode - 将 git 与 svn 一起使用的好习惯,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5294516/

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