关于 SVN 的建议<-> Git 工作流程

发布于 2024-10-01 10:44:23 字数 1217 浏览 4 评论 0 原文

我在使用 Git 时遇到问题。请记住,我对 Git 还很陌生。

问题:我需要将我的工作同步到我的家庭/手机。我的工作场所使用SVN,无法从外部访问(我无法更改这一点)。我也被阻止从 ssh 到外部(我也无法更改这一点)。回到我家,我需要提交更改。

建议的解决方案:

SVN Server -> Git (in my Office PC) -> Github -> Git (in my House PC)
SVN Server <- Git (in my Office PC) <- Github <- Git (in my House PC)

我选择 Github 的原因是因为它支持 HTTPS,这将解决我通过 ssh 到办公室外部的问题。

所以,我的问题是:

  1. 这是正确的方法吗?
  2. 如果它足够好,任何人都可以给我一个粗略的例子来说明我该如何做到这一点?

我知道第二个问题是个大问题,但我在将我的更改从我的房子合并回 SVN 服务器时遇到了麻烦。提前致谢。

更新:

我实际上已经考虑使用 USB 驱动器作为传输我的 Git 存储库的介质。然而,我希望有一种方法,让我根本不必使用 USB 驱动器(所有这些都在互联网上自动排序,担心我会把 USB 掉在某个地方)。我什至使用过 Dropbox 一段时间,但后来,存储库开始变得太大,Dropbox 无法很好地处理大量小文件(超过 20,000 个)。

经过一番考虑(过程的复杂性、数据的敏感性),我想我只会使用 USB 驱动器来传输我的 Git 存储库。不过,我会保留这个问题,以便我可以从这个问题中学习一些 Git 命令。

顺便说一下,这是我当前的工作流程:

  1. SVN Server -> Git(办公电脑)-> Github-> Git(家用电脑) 没问题
  2. 在我家:创建了一个登录分支并将其推送回 Github。
  3. 在办公室:我第一次从 Github 存储库克隆回来并合并登录分支。
  4. 然后, git svn init svn://url -s
  5. ???

我尝试了一些命令,但我认为它不起作用,希望有人可以帮助从第 5 步开始。

I'm having a problem using Git. Bear in mind I'm very new to Git.

The problem: I need to sync my work to my home/mobile. My workplace uses SVN and it cannot be accessed from outside (I can't change this). I'm also blocked from sshing to outside (I can't change this too). Back at my house, I need to commit my changes.

Proposed solution:

SVN Server -> Git (in my Office PC) -> Github -> Git (in my House PC)
SVN Server <- Git (in my Office PC) <- Github <- Git (in my House PC)

The reason I'm choosing Github is because of its HTTPS support, this will solve my problem in sshing to outside of my office.

So, my question is:

  1. Is this the correct way to do it?
  2. If it is good enough, can anyone give me a rough example on how can I do this?

I know 2nd question is a big one, but I'm having trouble merging my changes from my house back to the SVN server. Thanks in advance.

Update:

I've actually cosider using a USB drive as the medium to transfer my Git repository. However, I was hoping for a way so that I don't have to use USB drive at all (all automatically sorted in the Internet and was afraid I'll drop my USB somewhere). I even used Dropbox for a while, but then, the repository started to get too big and Dropbox doesn't play well with a lot of small files (more than 20,000).

After some consideration (the complexity of the process, the sensitivity of the data), I think I'll just USB drive to transfer my Git repository. However, I'll keep the question open so that I can learn some Git commands from this problem.

By the way, this is my current workflow in general:

  1. SVN Server -> Git (Office PC) -> Github -> Git (House PC) No Problem
  2. At my house: Created a login branch and pushed it back to Github.
  3. At the office: For the first time, I cloned back from my Github repository and merge the login branch.
  4. Then, git svn init svn://url -s
  5. ???

I've tried a few commands, but I don't think it's working, was hoping someone could help starting with step 5.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

樱桃奶球 2024-10-08 10:44:23

假设工作不希望您将代码库推送到 GitHub,即使在私人存储库中,您也可以将远程存储库添加到已安装的 USB 驱动器中,并来回携带它。

Assuming that work wouldn't want you pushing the code base to GitHub, even in a private repo, you could add a remote repo to a mounted USB drive, and carry it back and forth.

吹梦到西洲 2024-10-08 10:44:23

我想到了一些事情:

  1. 在 Github 上存储公司数据很可能违反公司安全策略。
  2. git-svn 存储库不适合在计算机之间共享。

也许一个不错的选择是将git svn clone存储库到闪存驱动器上。然后把它带回家,研究它,并建立承诺。然后你可以 git svn rebase &&当你开始工作时,按照正常的 git-svn 工作流程,从存储库中执行 git svn dcommit 。

编辑:您是否考虑过在备用端口上运行 sshd 或通过 HTTP(S) 代理 SSH?过去,我在使用一种或另一种技术时运气很好,具体取决于有效的限制。它可能不合规矩,但我确信这比将公司的源代码存储在 Github 上要好得多。

A few things come to mind:

  1. Storing corporate data on Github may very well be against corporate security policies.
  2. git-svn repositories are not meant to be shared between computers.

Perhaps a good option would be to git svn clone the repository onto a flash drive. Then take that home, work on it, and build up commits. Then you can git svn rebase && git svn dcommit from the repository when you get to work, as per the normal git-svn workflow.

EDIT: Have you considered running sshd on an alternate port or proxying SSH over HTTP(S)? I've had good luck in the past with one technique or the other, depending on the restrictions in effect. It may not be kosher, but I'm sure it's a hell of a lot better than storing your company's source code on Github.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文