SVN + Dropbox: sync project on Windows and Mac - xcode

I'm new to SVN so please be patient with my (maybe weird) question.
I have been working on a project with SVN on Windows 7 using Tortoise and WAMP for developing on my local machine.
As all the project is inside my Dropbox folder I'm wondering if there's a way to work on this even on my mac laptop with OSX Lion when I'm away from home (using xCode or whatever) and maintain consistency on both systems.
I read on the web about syncing xcode project with dropbox on several macs, but can it be done between windows and osx?

The idea with SVN is that you have a host where you push your code to. This host runs an svn server which manages your code and is able to distribute the code to multiple clients and accept changes from these clients. So if you have an SVN server somewhere, you don't need to use DropBox at all - just checkout your code from the server on your Mac and you can work on it and push changes to your server. On your Windows system, you can then just update your copy and get the latest changes that you pushed from your Mac.
If, however, you are using a local SVN server which stores your repository in your dropbox folder, things are a bit different. First thing to say: I would never do that. Second thing: You'd have to configure an SVN server on your OSX system to use the repository in your Dropbox folder the same way the server you configured on your Windows system does. If I ever needed to use a setup like that, I would never use SVN for it. A decentralized version control system like git or Mercurial is much better suited to handle this setup, because you don't need to have a server running - you can just sync between the DropBox folder and your local copy.

Why not use git? If you're new, don't bother learning something that's obsolete.
Be aware that different IDEs (XCode on OSX vs. whatever you're using on Win7) may mangle your line endings everytime you save from that computer.
Git has decent support for this sort of problem:
What's the best CRLF (carriage return, line feed) handling strategy with Git?
Finally, I'm not sure how you expect to "share" the project between two different build systems.
If you have a Makefile for your Windows build, you can make it a cross-platform one. See this:
makefile custom functions

Related

GIT GUI client on Windows for Unix GIT installation

Our company programs and runs data analysis on a Linux server. The programming is done in Windows clients (SAS, generally). Each project is only programmed by one person and is reviewed by another.
We would like to put our projects under version control but leave the code on the server (ie not pulling to local Windows repositories). The advantage is incremental backup and helps with confirming changes from the reviewer.
Does anyone know of a Windows client that can read remote repositories but perform GIT actions using GIT on Linux, rather than on Windows? Trying a few clients (e.g. SourceTree and SmartGIT) suggests only the latter is possible.
Thanks, Rich
One way to achieve what you want is to export the directories containing the Git repositories on your server over CIFS (via Samba) and then mount them as network disks on your workstations.
But really I can't understand what's wrong with using Git the normal way.
Deployment is best done using native packages for the target system (hard to do on Windows, I admit) or a tar.gz archive (doable using git archive) or a tool like git-ftp or rsync.
If you need code review, consider using Gerrit.
As to backups, each Git repository clone is, in a sense, a set of differential backups of itself. That is, the more (local) clones you have the safer you are.

Is there a good way to work with a remote git repo in Windows?

I want to be able to use Windows-based development tools (e.g. Winmerge, Eclipse, etc.) on a repo sitting on a remote Linux machine. With my current setup, I issue git commands in a shell via VNC, and therefore use the Linux-based tools -- kdiff3, gitk, gedit, etc. I do have access to all elements in the repo (source, .git/, etc.) via a Samba share. With this share -- mapped to a Windows network drive -- I work with whatever version my current git branch is pointing to.
Is there a Windows-based solution that works with a remote repo (say, over SSH) that allows me to execute the majority of my workflow (checkout, commit, diff, merge, etc.)?
Have you tried msysgit? Its a cygwin mingw based git client for Windows. I used it while I was using Windows and it works fairly well.
GitExtensions is a Windows GUI around msysgit, mentioned by Chaitanya. It has drawbacks but allows most Git operations to work in a graphical interface. I use it since I switched to Git.
You can use TortoiseGit to manage a clone of the repo right on your local machine. Your IDE should then be able to perform git operations directly on it. (Well, NetBeans can at least, I'm not an Eclipse user, so I'm not sure what git support it has built-in.)
MsysGit and the Git Gui are pretty effective from Windows. Start here
I have found that they do all the basics pretty well, and then I swap over to a git bash window [a git/unix version of a DOS cmd window, though more powerful] for the more specialist commands.
It has worked quite effectively and doesn't need any great expertise.

How to avoid physical path in bzr+ssh://myserver/C:\mydir?

I am starting with Bazaar (switching from Subversion, sorry if terminology is a bit off sometimes). Using Bazaar locally no problems.
Got bzr+ssh:// working on my Windows server (finally! and even ssh agent is working wow!)
Now I want a shared repository on the server from which the developers can branch to their machines. I want the repository in a specific folder, for example in C:\bzr\MyProject.
When I do:
bzr init-repo --no-trees bzr+ssh://myserver.com/MyProject
it creates the repository in C:\cygwin\home\user\MyProject in the home directory of my user account - it is understandable, but worrying.
Then as an experiment I also tried and succeeded:
bzr init-repo --no-trees bzr+ssh://myserver.com/C:\bzr\MyProject
This created the repository where I wanted. But how do I "map" or "alias" the URL (or bzr) so my developers can logon under their accounts and use URL
bzr+ssh://myserver.com/MyProject
to access the shared repository in C:\bzr\MyProject?
Obviously I don't want developers to use bzr+ssh://myserver.com/C:\bzr\MyProject because of the physical path in the URL.
Ok my own answer is if you want to run Bazaar on a Windows server for a development team who will access it over the internet,
and you are not familiar with Linux, Cygwin, SSHD and related stuff then it might turn out more complicated than you can bear.
I actually abandoned the Bazaar idea and gone with Mercurial. I must say Mercurial install on the server is also steep, but at least it is just Windows, IIS and only a bit of Python. Got it running in half a day.
Some of the problems that I had with bzr+ssh:// on a Windows server are:
Needs SSHD installed on the server. SSHD (from stripped down Cygwin) supplied with Bazaar refused to work. Had to install Cygwin and learn a bit of Linux stuff, how to run as a service, how to configure, how to generate keys.
Hard to add a new user in a way that does not request passwords typing for each command. Will need to generate a keypair, mock with copying the keys to th server in two locations (Cygwin's home user folder and Window's too). Probably need to log on the user to Windows to create a profile. Don't want developers logging on to the server actually.
Hard to set up a shared repository in a specific location on the server. Does not seem possible with bzr+ssh. Possible with sftp. Might need to use symlinks as bialix suggested above.
As a newbie to linux stuff I don't understand all implications of running sshd on the server and giving shell access to the developer accounts. Have to use bzr shell limited... documentation is scarce.
Basically, bzr+ssh:// on a Windows server seems to be what installing Subversion on a Windows server was like several years ago - hard. Hopefully it will get better with Bazaar too because I chose it over Mercurial initially.

How to setup PC and Mac for using git

I use git both for Mac and PC.
When pulling Mac's git from PC, it's easy as I can use ssh.
git clone smcho#prosseek:~/smcho/setup
The problem happens the other way round : to pull from Mac. I guess there are two ways to go.
Method 1 : Connect to server
By using 'connect to server' in Mac, I can make PC's directory like that of Mac. Even though, the file permission issue, it works pretty well.
Method 2 : ssh
I could run cygwin ssh server (cygrunsrv -S sshd) to be accessed from other computers, but for me, I have to wait quite a while to get connection as I explained here. It's almost impossible for to use it with git, as I don't want to wait for minutes to get clone.
Here comes my question.
Is there any better way other than the previous two methods?
Is there a (natural) way to support ssh server from Windows (windows 7 precisely) not using cygwin?
I've started using the philosophy of trying to stick in the native environment that something is designed for.
With that in mind, my windows box has an ubuntu server virtual machine that hosts my git repositories. The nice thing is the linux + virtual box + git is an awesome source repository that is completely free. No extra machine and you can give it very little memory so it isn't a resource hog.
There is even another option:
If you use both computers for developing and just want to keep the repositories in sync, you could create a bare repository and use something like Dropbox to synchronize it.
I see two other solutions :
using a third synchronisation server: GitHub, the most famous (if your program is OpenSource), but you can also find free online private Git repositories
on Windows, you can set up the Git server ('git daemon' command). On MAC, you'll access to the Windows repository using the URL git://ip_of_windows_machine/repository/
You might consider another approach entirely. If you're using git as a revision control system that you might consider a hosted account for mastering your repository, maintaining backups, etc. http://github.com/ is the leader in the space for git.

How to avoid Mercurial repo corruption when sharing a repository between Windows/Mac?

I have several projects which are shared between Windows and Mac. The dev machine is a Mac running Parallels: the files are stored on the Mac side, and the source is shared to the Windows side. This is very convenient, as I can switch back and forth between Windows and Mac tools rapidly without having to sync files.
Recently I switched from Subversion to Mercurial, and now I'm having problems with the Mercurial repository becoming corrupt if I use the Windows tools to add/update, etc. I have to be very careful about which operations on the Windows side are safe (mainly the read-only stuff) and of course I forget rather regularly.
Does anybody know why the corruption occurs? I thought Mercurial repositories were platform-agnostic. Any ideas how to prevent it without removing the Windows tools entirely?
Are both the windows side and the OSX side using the same version of mercurial. Mercurial has great backwards compatibility at the network and file level in that any version can push/pull/commit to any previous version's repositories, but it's not forward-compatible, so if your windows side is using mercurial 1.0 and your OSX side is at 1.5 then windows shouldn't be committing to a clone created by the OSX side.
In general mercurial was built for a clone-per-user-per-system and having conflicting actions mediated through push and pull. Shared repos accessed by multiple clients for local-only actions like commit isn't the recommended use case.
Editing on both systems is fine, but commit from OSX only. On the windows side you could enforce that by putting something like this in your %USER_PROFILE%\Mercurial.ini file:
[hooks]
pre-commit = c:\doesnotexist.exe
That should be enough for the hook to fail, which will stop the commit from going through.

Resources