3

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.

4
  • This seems a reasonable way to do this (though you can also clone or bundle to a thumb drive), and you shouldn't have any trouble pushing and pulling between your various git repos. It's just the git-svn bit you're having trouble with, right? If you can clarify exactly what problems you're having with that, we might be able to help you out more easily. Commented Nov 9, 2010 at 4:28
  • 3
    Are you/ will you be paying for github access, or using their free accounts? If you want your own ability to track changes locally without being in contact of the SVN server, then either git-svn or hg-svn will work nicely for you. However, in this set up you are also placing company data on machines that are not part of the company, so you might want to ask about the acceptability of doing such a thing (chances are it's not). Additionally, github's free accounts are public (they're meant for Open Source projects), so keep that in mind if you want to pursue this. Commented Nov 9, 2010 at 4:31
  • As everyone else has said, publishing proprietary code in a public place might be a bad plan. My first comment wasn't intended to endorse sharing private data; I just assumed that since the question was posed, that'd already been considered. Commented Nov 9, 2010 at 4:33
  • @Jefromi, @birryee: I'm paying for the Github account, so, it's a private respository. I'm assuming it's all good as it's a private repository. Commented Nov 9, 2010 at 5:55

2 Answers 2

2

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.

Sign up to request clarification or add additional context in comments.

1 Comment

I have to accept this as the solution, it's just too much work for me to use my own solution.
1

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.

5 Comments

What's the problem with sharing git-svn repos? I haven't really used them, but surely worst case you can always get what you need back into the appropriate branch in the original git-svn repo and then git svn rebase and dcommit, yes?
You can, yes. But if development diverges at all the result can be tricky to apply appropriately. This case isn't as bad as others I've seen, but using one cloned git-svn between computers can become problematic especially if they are used to develop by different people. The conventional wisdom I've seen is that git-svn clones should not be pushed or pulled.
Hm. I guess that makes sense - but if it's just you, I can't see how it'd ever be that hard to just rebase everything on top of your main branch and call it a day. (Though I'd cringe at throwing away pretty history to do that.)
"git svn clone the repository onto a flash drive"? If ssh is blocked, you could bet that flash drives are blocked too. I know they certainly are in my shop.
I push git-svn repos all the time without trouble. The remotes are mostly read-only, but I have pulled on occasion. A little care about keeping clean, linear history in git master prevents turds from showing up in svn.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.