How to set up a git repository in Windows VPS? - vps

I have a VPS - Windows Server 2012 R2 and I already install GIT on the server.
Now I want to set up a repository on it and our team can clone that repository to local computer and work on it.
I try to find the way to set up but I have not found any posts.
How can I set up it? Can I use any tool to set up on vps and commit from local machine?

You need a listener (Apache or ssh) in order for Git on your VPS to listen to Git queries (clone/pull/push)
You can use:
ssh (with an ssh server)
IIS (with Bonobo Git server)
https with a Go server (multiplatform) like Gogs

Related

Need to clone repository after SSH into server using TeamCity

I have a job that SSH into server and after that I need to git clone repository into this server that I SSHed before. How could I do it?
I set VCS checkout mode on agent, and set custom path
I think there are two ways to achieve it:
Use SSH Exec runner to execute git clone on remote machine
Use SSH Upload to upload previously cloned repository to remote machine
First one is faster but you need to take care of git auth on remote machine.

Accessing TFS code from Docker

I have a docker running on my local Windows box and I need to clone the code from our TFS server using Git.
Docker is using linode/lamp (debian). Running # git clone http://our_server/tfs/The_Project
I get
Cloning into The_Project ...
Username for http://our_server: xxxxx
Password for http://our_server:
fatal: Authentication failed for http://our_server/tfs/The_Project
This does not look like a docker issue but just a case of git clone from Linux to TFS git repo: you can look there for an answer.
TFS requires Windows Authentication so your options are:
change TFS configuration to allow Basic Authentication
change TFS configuration to allow SSH
install Git Credential Manager for the OS in the container

Git how to access repository Windows local machine?

I installed Git for Windows in order to clone and pull a project hosted on a remote Linux server.
In my repository (D:/repositories/my-project) I launch the following commands
git clone server#192.168.56.101:/var/www/web/my-project/.git
git pull origin master
So far so good. I pull the project files whenever modifications are applied on the server.
But now I'd like to pull or push from the remote server to my local repository.
I tried many things but I can't figure out how to access the repository located on my local machine.
Things like:
git pull duddy#my-pc:/d/repositories/my-project/.git master
just doesn't work, Git says:
ssh: Could not resolve hostname my-pc: Name or service not known
fatal: Could not read from remote repository.
Can someone helps me ?
First things first, I would recommend you try simply running git pull.
If this doesn't work, try running git remote -v and check to make sure that the URL for your server is listed as an origin (server#192.168.56.101:/var/www/web/my-project/.git).
Your issue is that you are inputting the URL for your local repository in your attempt to git pull.
I suggest reading the git-pull documentation to learn more about how pull works.
Basically, you need to have some service at your workstation which serves the requests. There are following options (I did not try most of them myself, just making it up from what I know):
use the windows file access. This is the easiest to setup at the windows workstation - just share the repository folder. The Linux side should somehow be able to mount windows shares (like described, for example, here: https://wiki.ubuntu.com/MountWindowsSharesPermanently). If you manage to mount your \\my-pc\repo to some /mount/my-pc-repo, then you can access it as file:///mount/my-pc-repo.
run git daemon at windows. Set up instructions are available at SO (for example, https://stackoverflow.com/a/2275844/2303202) and it pretty straightforward, but it does not have any authentication and in most cases it is reasonable to use it only for reading, so you will not be able to push to the workstation, only fetch.
set up ssh daemon and access through ssh authentication with read-write access. Git for windows installation contains the needed software (the sshd.exe binary, it is there at least for Git for Windows 2.6.0), probably there is a way to utilize it but I could not find it quickly.
set up HTTP(S) service at your workstation. I don't know if it is possible to do only with Git for Windows (it might be, with some perl module which happen to be included with it), or you should use some other software.

setup remote Git server for testing EGit

I need to setup a Git server on windows 7 with IIS to test my EGit with eclipse. Eventually it would be use to checkout and checkin from a remote server. But I would like to test the remote checkout and checkin for EGit using a local server as of now. I have tested it to work with Github (only https not SSH, SSH seemed to have a problem). But I would like to host my own git remote server for EGit. Please let me know as to how to go about it. Thanks in advance.
You can use the "Git Web Access" project:
For those who have interests in a Smart-HTTP Git server on IIS, the project provides an ASP.NET HttpHandler that let you run Smart HTTP Git on IIS.
It is inspired by Grack, a Ruby Rack based application for Smart HTTP Git and git_http_backend.py, a python implementation of Smart HTTP Git.
You also can try out the "Bonobo-Git-Server" project, through its main project 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.
You will find other alternatives (sometime older) in "How to setup GIT bare HTTP-available repository on IIS-machine".

Backup of SVN repository, located on Linux server, to Windows Client

I try to create a backup of my SVN repository, located on Linux server, from Windows command-line Subversion Client:
C:\project>svnadmin hotcopy svn://"URL_of_my_SVN_repository"/ C:/BACKUP
and receive following error:
svnadmin: E205000: 'svn://"URL_of_my_SVN_repository"/' is a URL when it should be a local path
How I can solve it? I need to initiate a backup my SVN repository from Windows PC (due to our network policy I have access to the Linux server port 3690 (SVN) only).
According to the documentation, you can't run svnadmin from a remote machine:
Since svnadmin works via direct repository access (and thus can only be used on the machine that holds the repository), it refers to the repository with a path, not a URL.
The standard approach to backing up to a remote location is to combine multiple tools:
Run svnadmin on the machine which serves svn.
Use a tool like rsync to copy that repo dump from the svn server to the machine which will be backed up.
If your network policy allows you to run an svn server on a machine, but not to schedule svnadmin backup jobs on that machine, then I think you need to re-consider your network policy.

Resources