1

Disclaimer: I know there is a similar question here (Working offline with SVN on local machine temporary), but my problem is slighty different.

So I have a remote SVN server and my main developer machine. Additionally there is notebook, which for various reasons has no Internet access at all. But I still need to work on it from time to time for several days (while traveling).

Now what I need would be to push the latest version of the code from the main dev machine to the notebook (via a USB stick), then work on that offline notebook for several days, committing changes to a local repository, and on my return merge all changes made on the notebook to the data on the main dev machine, again via USB.

I assume I would need something like Git. Unfortunately I cannot use git-svn, because as said this notebook is never online. Instead I can only exchange data via USB.

Any ideas how I could manage this setup in a practical manner (e.g. with Git or similar)?

Community
  • 1
  • 1
Matthias
  • 9,817
  • 14
  • 66
  • 125

2 Answers2

0

I don't see your problem using git-svn. Just do the git svn clone, copy whole directory to the offline laptop and hack away. On return copy the dir back and sync with svn. All the git's stuff is located within the .git hidden folder.

Mykola Gurov
  • 8,517
  • 4
  • 29
  • 27
  • I joust found out about git bundles. Would they solve my problem? – Matthias Feb 06 '15 at 10:50
  • Won't copying be easier? – Mykola Gurov Feb 06 '15 at 13:48
  • Proably true. But why the detour via git then at all, and not just copying the whole directory to USB, and later back again? Well, maybe if I need the commit log ... – Matthias Feb 06 '15 at 15:46
  • Git gives you much flexibility indeed - you can switch between branches, compare revisions etc. You can also do frequent commits thus avoiding accumulation of a big messy diff with unrelated changes. – Mykola Gurov Feb 06 '15 at 16:07
-1

The only solution I see is to make a copy of your SVN server on your USB, with:

$svnadmin dump /path/to/repo > dumpfile.dmp
$svnadmin load /path/on/your/usb < dumpfile.dmp

then, work with this repository in offline mode. When you want to merge your commits during your travel, you can make an incremental dump of your USB repository:

$svnadmin dump -r X --incremental /path/of/usbREPO > incrementalDumpfile.dmp

Where X is the latest version on your remote server Version.

Then, you have to load this latest dumpfile on your repository on your return.

Hope it helps.

David Mic
  • 117
  • 1
  • 9
  • Hmm... this solution would work only if nobody else is commiting to the main SVN server in the meantime, wouldn't it? – Matthias Feb 05 '15 at 16:07
  • Exactly, sorry if I missunderstood you, I've made this solution assuming you're the only one committing to this repository, if more people has to commit on that repository, I think you cannot make your offline mode cause repository will be changed when you load on the repo again. The only way I see it can work is if you're the only one that commit over the same files, if another worker commit on that files too, probably you cannot use this way. My only advise is make a branch for your working, work on that branch and then add it to your repo once you returned to your online working. – David Mic Feb 06 '15 at 12:06