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.
Related
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
How can I share a Git repo on Windows? The "correct" ways appear to be to run "git-daemon" (unix specific) or run ssh (unix specific) or run an http front end for Git. If I just have two Windows boxes and don't feel like installing Unix just to run Git, what is the optimal way to share the repos between the two boxes?
If both machines are in the same LAN, you can put the repo in a directory shared via the regular Windows network protocol (SMB).
(Disclaimer: I'm not certain about locking semantics for SMB, so it could be that simultaneous writes to the repo could corrupt it. Then again, the same probably holds for Unix.)
If you want easiest way, you have to see at SCM-manager
The easiest way to share and manage your Git, Mercurial and Subversion
repositories over http.
In order to have http-served repository with nice Web-frontend and management you have to have only Java (Java, not JRE)
Another alternative instead of running a virtual machine is to run all the Unix stuff in Cygwin. With Cygwin you can set up an ssh server on your windows machine as well as gitolite. And it runs natively on your hardware instead of a virtual machine.
Cygwin installation is very straight forward. It's just a single executable that downloads the packages you need. Keep the installer around because it's what you'll use to add and remove software in Cygwin.
Running gitolite on Cygwin is not as simple but just google "cygwin gitolilte" and you'll find lots of tutorials.
Git is a distributed version control system. So, in most situations, you don't need a dedicated program to serve the content in the repository, you just need a way to access the repository from both machines. One way of doing this is like #thomas suggested and placing a clone of the repository in a shared network location.
Another way that I have found successful in the past as a broke graduate student, is to use Dropbox as the "master" repository. Basically, you git clone your repository into your Dropbox directory, then you can setup Git on both machines to push/pull from the Dropbox repository. Dropbox will do the syncing magic in the background. This only works for mildly active repositories.
What I have done in the past is just run a VM with a small linux client on one machine through virtual box. You only need to port forward the ssh port and you're good to go - no need for configuring the network to something complicated on the VM.
This will allow you to run things like gitolite to manage users.
For this and many other reasons, I've switched to running Linux for all my machines and just run windows in a VM when I need to do Windows development. Lots of great services that you can run on Linux are more easily connected to from the guest OS than the other way around.
If you will have only the 2 windows machines, you can add a url to the remote, but ensure it is done via the file protocol. ie:
git remote add origin file:///\\some-server/share/repo.git
Some people claim that if you use just a path, git will try to make hard-links between the 2 repos. AFAIK, msysgit does not do this and you can use a path with no file protocol:
git remote add origin /z/somepath/repo.git
if z is mapped to a share on the other machine. I didn't need to run a server in your scenario.
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.
I have git on my laptop and on my PC. I just want to sync (push/pull) them without using any other server. Both of my laptop and my PC uses Windows 7. Is there any simple solution for me? I can not go through guides like this
http://www.timdavis.com.au/git/setting-up-a-msysgit-server-with-copssh-on-windows/
because they to install and configure many things.
Regards,
I use dropbox for this task. My dropbox contains the git repositories, which are cloned to each host. Then you could easily push and pull against it.
If you try this approach you have to create a bare repository in your dropbox. Add this as remote to your local one.
See also Using Git and Dropbox together effectively?
You can use the local protocol (i.e. a shared network path between your two PC).
I recommend pushing to:
a bare repo (you set one bare repo on each side)
actually a bundle (which is a bare repo represented as one file)
Then you can use dropbox to save and keep that bundle in sync if you want: it is much easier to backup one file than a all .git content.
WindowsGit.com offers a $9 installer for setting up a git server that is definitely faint-hearted friendly, unlike Mr. Davis's excellent tutorial ;) It takes under five minutes, and all the steps fit in a half-page of instructions. It's hard to mess up, and has support.
It sets up a dedicated SSH server which only allows acess via the public keys you provide. It has an isolated copy of Git so it won't interfere with whatever else you have installed.
It's fast, clean, secure. It's GPL-licensed, but the binaries cost $9, which pays for some of the the hosting, support, and development costs.
I'm the webmaster for the site, so I'm obviously biased. I'd love to hear about any alternative or similar products out there, though.
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.