开发者

Advice on SVN <-> Git Workflow

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, t开发者_如何转开发he 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.


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜