1

I work both with Linux and with Windows, where I use cygwin for git. The latter is usually good enough, but for more complicated operations it's damn slow and not all tools are available or work properly.

That's why I quite often push my changes from Windows to my private "server" repository, pull them on Linux, clean things up and force-push-pull them back. Normally, this works perfectly, but when a merge conflict occurs I can't commit and thus there's nothing to push.

Given the flexibility of git, I'm sure there's a way to transfer the current state to another repository. My question is "how?".

maaartinus
  • 44,714
  • 32
  • 161
  • 320
  • you can use the commit hash – Shawn Dec 13 '13 at 05:04
  • Using one or another operating system by itself does not cause git conflicts - it is the way you use it does. Perhaps you should explain what is the issue that you are having under cygwin. That said, you can simply rsync full copy of repository to completely replicate state. – mvp Dec 13 '13 at 05:07
  • @mvp: "Using one or another operating system by itself does not cause git conflicts" - agreed, sure, obviously.... It's just that using Windows makes any work (including conflict resolution) much harder. Using cygwin, a simple checkout of a different branch may take a few minutes, rather than milliseconds. Using `perl -pi` leads to a deleted file rather than an inplace edit. And so on... – maaartinus Dec 13 '13 at 05:28
  • Perhaps try performing some housekeeping using `git gc` if you have not done so already to see if that improves speed of Git commands. – miqh Dec 13 '13 at 06:33

1 Answers1

0

Note: msysgit (Git got Windows) would be much faster than Git on Cygwin.

Given the flexibility of git, I'm sure there's a way to transfer the current state to another repository

One way is to create a git bundle

 cd /path/to/your/repo
 git bundle create ../repo.bundle --all

And copy the one file generated from system to another. You can clone from a bundle.

But if by "current state" you mean one where there is a merge in progress, then it is not easy to do, unless you try to put everything in an archive (.zip).

The real solution would be to resolve the merge conflict directly on Windows, with msysgit and some external diff tools associated as git mergetool and for git difftool.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • @mvp I agree, I much prefer resolve the merge locally than trying to transfer it in any way. – VonC Dec 13 '13 at 07:32
  • I switched from `msysgit` to `cygwin` for several reasons, mainly: The classic Unix copy-and-paste doesn't work (the menu is a real PITA). I'll give it another look. And yes, I mean merge in progress. AFAIK `zip` has an option for symlinks and `tar` preserves them by default. – maaartinus Dec 13 '13 at 11:29
  • @maaartinus don't bother with Cygwin: you will have much more issues than with msysgit. – VonC Dec 13 '13 at 11:30