GIT central repository on Windows network share - windows

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

Related

git server between laptop and PC (MS Windows 7)

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.

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.

Setup an SVN Server?

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/

Setup a Git server with msysgit on Windows [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
My friends and I are trying to setup Git for Windows using the tutorial Git Server: Gitosis and Cygwin on Windows, but we just keep running into problems.
What would a "Setup Git Server" guide for Windows using msysgit be like?
There is a comment in the tutorial above suggesting it can't be done with msysgit because gitosis requires the use of an SSH Server and Bash? What is a step by step guide (as there is not one available)?
Install mysisgit
?
I found this post and I have just posted something on my blog that might help.
See Setting up a Msysgit Server with copSSH on Windows. It's long, but I have successfully got this working on Windows 7 Ultimate x64.
Bonobo Git Server for Windows
From the Bonobo Git Server web page:
Bonobo Git Server for Windows is a web application you can install on
your IIS and easily manage and connect to your git repositories.
Bonobo Git Server is a open-source project and you can find the
source on github.
Features:
Secure and anonymous access to your git repositories
User friendly web interface for management
User and team based repository access management
Repository file browser
Commit browser
Localization
Brad Kingsley has a nice tutorial for installing and configuring Bonobo Git Server.
GitStack
Git Stack is another option. Here is a description from their web site:
GitStack is a software that lets you setup your own private Git server
for Windows. This means that you create a leading edge versioning
system without any prior Git knowledge. GitStack also makes it super
easy to secure and keep your server up to date. GitStack is built on
the top of the genuine Git for Windows and is compatible with any
other Git clients. GitStack is completely free for small teams1.
1 the basic edition is free for up to 2 users
With regards to the reference to the Tim Davis page - Setting up a Msysgit Server with copSSH on Windows - I used this to get a Git server running on Windows 7 Home Premium 64.
Below is a postmortem/update of what I learned in addition to his instructions.
Like Tim Davis said, this was an arduous and frustrating process, at least for me - I'm not too good with integration of this sort, but I learned alot in the process. I hope my pain benefits someone else in the future, because this was an arduous process.
There is a step to copy all the Git
executables into your CopSsh bin
directory. Instead of copying files
and figuring out which files are
needed, add the git bin path to your
git path. I did so by modifying my
.bashrc and CopSsh profile.
Here's what I added to .bashrc (in your CopSsh and Windows home directory):
gitpath='/cygdrive/c/Program Files (x86)/Git/bin'
gitcorepath='cygdrive/c/Program Files (x86)/Git/libexec/git-core'
PATH=${gitpath}:${gitcorepath}:${PATH}
Here's what I added to the bash profile (in CopSsh etc/profile):
gitpath='/c/Program Files (x86)/Git/bin'
gitcorepath='cygdrive/c/Program Files (x86)/Git/libexec/git-core'
export PATH="/bin:$syspath:$gitpath:$gitcorepath:$winpath"
There is some duplication here - it works for me, so someone chime in which is the correct place to modify the path.
The newer msysgit versions might not give you
the screen to choose the ssh
executable where you choose between the Git
ssh and PuTTY ssh. You'll have to
set GIT_SSH manually if you use PuTTY.
I didn't follow one part of the
instructions and that was installing
Tortoise - I used the command line
instead as that's how I prefer to
learn a vcs like I did with rcs and Subversion and
found that to work for me. I had
problems with the clone command
using ssh. Here's how I did it:
Git clone using ssh - can't find repository
This is where I banged my head the most.
The CopSsh install directory was
/Program Files (x86)/ICW. I got
away with this, but if I were doing
it again, I'd use a directory name
with no spaces.
These other sources helped me figure things out:
Another way to setup a Git server
on Windows:
http://code.google.com/p/tortoisegit/wiki/HOWTO_CentralServerWindowsXP
The client side of things:
http://toolmantim.com/thoughts/setting_up_a_new_remote_git_repository
An explanation of Git as a server
(not related to Windows, but a more
in depth look than installation
steps):
http://progit.org/book/ch4-0.html
Plus O'Reilly's Version Control with Git - the Remote Repositories chapter.
In retrospect, if I had known how time consuming this would be, I might have started out with Mercurial as I read the install on Windows is easier, but I'll have an opinion on that after I work with Git awhile and then try Mercurial.
I am not sure why anyone hasn't suggested http://gitblit.com. Pure java based solution, allow HTTP protocol and really easy to setup.
After following Tim Davis' guide and Steve's follow-up, here is what I did:
Server PC
Install CopSSH, msysgit.
When creating the CopSSH user, uncheck Password Authentication and check Public Key Authentication so your public/private keys will work.
Create public/private keys using PuTTygen. put both keys in the user's CopSSH/home/user/.ssh directory.
Add the following to the user's CopSSH/home/user/.bashrc file:
GITPATH='/cygdrive/c/Program Files (x86)/Git/bin'
GITCOREPATH='/cygdrive/c/Program Files (x86)/Git/libexec/git-core'
PATH=${GITPATH}:${GITCOREPATH}:${PATH}
Open Git Bash and create a repository anywhere on your PC:
$ git --bare init repo.git
Initialized empty Git repository in C:/repopath/repo.git/
Client PC
Install msysgit.
Use the private key you created on the server to clone your repo from ssh://user#server:port/repopath/repo.git (for some reason, the root is the C: drive)
This allowed me to successfully clone and commit, but I could not push to the bare repo on the server. I kept getting:
git: '/repopath/repo.git' is not a git command. See 'git --help'.
fatal: The remote end hung up unexpectedly
This led me to Rui's trace and solution which was to create or add the following lines to .gitconfig in your Client PC's %USERPROFILE% path (C:\Users\UserName).
[remote "origin"]
receivepack = git receive-pack
I am not sure why this is needed...if anybody could provide insight, this would be helpful.
my git version is 1.7.3.1.msysgit.0
GitStack should meet your goal. I has a wizard setup.
It is free for 2 users and has a web based user interface. It is based on msysgit.
There is a nice open source Git stack called Git Blit. It is available for different platform and in different packages. You can also easily deploy it to your existing Tomcat or any other servlet container. Take a look at Setup git server on windows in few clicks tutorial for more details, it will take you around 10 minutes to get basic setup.
You don't need SSH for sharing git. If you're on a LAN or VPN, you can export a git project as a shared folder, and mount it on a remote machine. Then configure the remote repo using "file://" URLs instead of "git#" URLs. Takes all of 30 seconds. Done!
There may simply not be such a guide. If so, you may not have much luck convincing anybody to write one, because it would be a lot of work.
I would recommend either of two things. The easier one is to follow the guide you have slavishly, which means forgetting about msysgit.
The harder one is to put up a Linux server - perhaps as a guest under Windows using VirtualBox (free) or VMWare or Parallels (pay), and then follow one of the many sets of instructions Google will lead you to. But you will probably find those instructions are insufficient - they usually assume you've already set up an ssh server, for example, so you have to get that info elsewhere. I've done that twice, and can say that unless you're already something of a Linux guru, it will be a struggle.
I did what Bob Murphy suggested was the "hard" option.
I installed Ubuntu under VMWare Server (free) at work and then followed this guide on setting up Gitosis. I found it much easier than trying to get it going under Windows. Once it's set up you really don't have to touch it because Gitosis administration can be done from Windows by pushing updated versions of the gitosis.conf file. Any work I do need to do on the server directly is done via PuTTY so I don't have to use the horrible VMWare Server interface.
I've recently been messing around with VirtualBox at home and I've found it much nicer/easier to work with than VMWare Server, so it may be worth looking at that.
I just wanted to add my experiences with the PATH setup that Steve and timc mentions above: I got permission problems using shell tools (like mv and cp) having Git's shell executables first in the path.
Appending them after the existing PATH instead this solved my problems. Example:
GITPATH='/cygdrive/c/Program Files (x86)/Git/bin'
GITCOREPATH='/cygdrive/c/Program Files (x86)/Git/libexec/git-core'
PATH=${PATH}:${GITPATH}:${GITCOREPATH}
I guess CopSSH doesn't go along well with all of msysgit's shell executables...
I'm using GitWebAccess for many projects for half a year now, and it's proven to be the best of what I've tried. It seems, though, that lately sources are not supported, so - don't take latest binaries/sources. Currently they're broken :(
You can build from this version or download compiled binaries which I use from here.

I currently use SVN with Linux. How do I add files from my Windows Desktop?

You know, the regular "svn commit". "svn up."
When I did svn co, it was linked with SSH.
svn co +ssh or something.
How would I link this with Windows? I'm using Windows and I'd like to put some code i this SVN. What tools do I use to get started? Can I checkout normally, with the Linux syntax?
For Win you REALLY wan't to use http://tortoisesvn.tigris.org/. It's a GUI to SVN and facilitates things a lot.
EDIT
You also might find this tutorial helpful: http://tortoisesvn.net/ssh_howto.
Cheers.
If you simply want to use a Subversion client on Windows, the best option is TortoiseSVN.
If you want to have your own Subversion repository, then do the following.
Subversion involves two kinds of parties: the server, which has all the data necessary to construct the repository, and the client, which performs most of the user-initiated operations against the repository. You need to do a few things:
Set up a Subversion server.
Add or create the relevant repositories.
Make sure the server is visible to all the clients that want to see it.
Then each client simply accesses the server the same way, e.g. svn co http://mycomputer/svn/shared/trunk.
Yes you can use the normal syntax but it's probably easier to use tortoisesvn which gives you a nice explorer plugin
If you're coming from Linux to Windows, you'll want to install cygwin. Lots of tools you'll really miss on Windows are available from cygwin.
It's good to know that TortiseSVN is there, but it's just a svn gui. It's unlikely that anyone coming from a Linux environment would be interested. I used it briefly then got rid of it.
If you want to check out repositories by URL, you will need to set up Apache, including the DAV modules. Check here: https://web.archive.org/web/1/http://articles.techrepublic%2ecom%2ecom/5100-10878_11-5902186.html
Another option over tortoisesvn, if you use linux and windows (like me) AND you use eclipse on both is to use the eclipseSVN. This way usage on both OSes are the same. You can get it by doing a Software Updates in Help of eclipse.

Resources