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.
Related
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.
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.
Our company is looking at setting up a central GIT repository. As we are using Windows, we've been looking at using a network share solution, based on the following articles here and here.
However, after thinking about this I have some questions. (Warning - I'm a noob at GIT)
It seems that this solution might allow developers to cause problems with the repo, by allowing them to map to the drive and play with the files (outside of the GIT client). Is there a way to prevent this? Or do I misunderstand something here?
If your using network shares, does the GIT installation on the server actually have a purpose? Or is it just clients pushing back and forth from the share.
Any advice on a best solution would be appreciated.
Thanks.
What worked best before was an install of gitolite on a linux vm. This way you have many admin options. I highly recommend gitolite.
You are correct in that with the windows share (although easy), you sacrifice some functionality.. permissions and server-side hooks come to mind.
Here's another question that might help: How to setup and clone a remote git repo on Windows?
Or this: Setup a Git server with msysgit on Windows
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.
Does anybody know how to setup a basic SVN server on my windows pc? I want to create an SVN repository to store the code for my home projects I've got lined up.
Anyone know how to do this?
Install VisualSVN Server. The server part is free. You can also just use any SVN tool to just create local repositories on your file system if you like. My favorite client side tool is TortoiseSVN.
I can strongly recommend VisualSVN. It's very easy to setup, configure and use.
I've installed it recently and have found it utterly pain-free. SVN client-wise, I'd recommend TortoiseSVN. It integrates directly with Explorer and is, again, easy to use.
If you're working with Visual Studio, AnkhSVN is a great client that integrates into VS and doesn't seem to have any problem with being used side-by-side with TortoiseSVN.
I use VisualSVN on my Windows 2008 server and it works great. I then use TortoiseSVN on my client machines. The installation is painless and you should be up and running in no time.
If you are the only one accessing the repository all you need is tortoisesvn. You can make a local repository anywhere you want just by right clicking and selecting "Create Repository Here" then just use the file path for the URL.
I would also recommend Visual SVN if you like to get SVN installed on your Windows PC. There is a nice tutorial that describes installation and configuration process.
However think twice before hosting your product locally as that isn't the best option.
I would also Check out Assembla. Online hosting for both SVN and Git. I have used both VisualSVN and Assembla for personal projects.
Use ubersvn for personal use it is working fine and it's freeware.
The program contains all the dependencies needed to set up and run an Apache Subversion server on Windows, Linux or Mac OS X operating systems
.Check this here
What is the final veredict? for a single user local repository what would be the best option:
just create local repositories with TortoiseSVN (simpler and less
resource consuming)
install VisualSVN server to get the extra functionality it offers
(for example, the automatic backups are quite interesting..)
The idea of using VisualSVN server in my local machine with the automatic backups stored in a google drive folder in order to keep the repository in case of catastrophe sounds good, but maybe is a bit overkill.. is it heavy the server initialization? the machine is only booted while I am working in my spare time.. if the server takes no negligible time to start every time I turn on the PC maybe the first option is better.
Check Beanstalk it's not really an answer to the question you asked, but it might save you a lot of trouble. You could also check the VM marketplace, there are many virtual machines that would get you up and running super fast.
Here's also a very nice one called PMRepo, it includes Trac, Subversion, and Hudson in one VM.
If you want to create SVN repo, you can use this VisualSVN
By using this tool, you can easily create SVN repo and it will give it's REPO URL. so you can use it for cloning. It is the easiest way to create repo in any machine and use the its repo URL
before setting up SVN you need:
1.Install Putty http://www.putty.org/
2.Creat Droplet on Digital Ocean
3.Install Apache,Install PHP,Install phpMyAdmin
after that follow steps on below link:
https://progtec.wordpress.com/2015/10/18/how-to-setup-svn-server/