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

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.

Related

Deploy the directories to remote windows server

Am using Teamcity as my CI, after checking out a repo from Github i need to deploy the files and directories to one of the remote windows machine
Note: Both my Teamcity agent and remote machine are having windows OS
Please help me to achieve the same with command line or by any of the plugins.
You can use the TeamCity Deployer plugin to gather artifacts and deploy them to a network share or FTP.
Create new network share on your target Windows machine and configure correct write permissions for the share and NTFS folder. Use the network share address in TeamCity build configuration. The machine running TeamCity agent must have access to the network share.

How to set up a git repository in Windows 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

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.

Laravel build locally and auto deploy to remote server

My web application are built on latest laravel framework with it's front end task and dependencies are managed through gulp, node, npm and bower.
My remote hosting server basically supports git only and does not support nodejs and npm. So currently I am building it locally and deploying it manually via ftp.
So, is their any tools that simply track the changes on locally build file and uploads the changes on the remote? Or may be there are better ways to do it?
What you are describing could be fixed by committing your locally built files.
If it supports git and you have ssh access - set your remote repository local machine. Commit your local build files and push to a remote repository. Pull changes from remote repository on remote server.
I had a similar situation where I was stuck with ftp and using Laravel.
To aliviate the agony of using ftp, I found this tool called dploy.
It simulates git in ftp, so you commit locally or to your remote repository, and dploy will take care of synchronizing your local build with your live server.
https://github.com/LeanMeanFightingMachine/dploy
I hope it helps.

How to git clone a repo in windows from other pc within the LAN?

I have this git repo "c:/xampp/htdocs/**" in my main PC and its IP address is 192.168.0.6. Now I want to git clone this repo from ubuntu-server which running on a Vmware Player in my main PC.
I did
git clone \\192.168.0.6\c:\xampp\htdocs\****
and
git clone //192.168.0.6/c:/xampp/htdocs/****
from ubuntu-server and neither worked.
fatal: could not create work tree dir '****'.: Permission denied
What did I wrong?
what should I do?
You should use the command git daemon to host your repo, like this:
In your computer that will act as a server:
git daemon --base-path=<path_to_folder_containing_project_folder> --export-all
(please note that path_to_folder_containing_project is the folder containing your projects folders, it will provide all projects under that folder)
In your client:
git clone git://<local ip>/<project name>
The cloned repo will have its origin pointing to the server in your LAN, so you may want to use git remote set-url origin to point it to the original origin.
You may want to run git daemon with the --verbose option to get more details in case you run into problems.
Make sure that your c:/xampp/htdocs folder (or sub folders of it) is shared in windows, so you can navigate on the network by this address:
\\192.168.0.6\htdocs
Then you clone by using file:////. Note that there are four slashes:
git clone file:////192.168.0.6/htdocs/somerepo.git
To access the repo, you must either share it on 192.168.0.6 or must be the same domain user as the one that owns the file on 192.168.0.6.
If you share the directory on 192.168.0.6 (e.g. with share name myrepo), you access it with //192.168.0.6/myrepo.
If you are logged in on your box with a user accout that is known on 192.168.0.6, you could try accessing the repo through the administrative shares:
//192.168.0.6/c$/xampp/htdocs/...
Always use forward slashes.
Another alternative would be using SSH to access the remote machine.
Using explorer (smb) to mount the remote repository as a network share is the easiest way. I'm not entirely sure, but I think you paths might be wrong. Try file:///192.168.0.6\c:\xampp... instead.
There are two things that might have gone wrong for you:
You don't have read permission on the remote repository
You don't have write permission in the location you want to create your repository ( the current working directory or the directory you specify as second argument to git clone)
And also check if your samba server works for normal file access.
To make git repo on Windows local network you'd need to do the following:
Create new repo
git init --bare projectName.git
Share this folder (projectName.git) with the users you need
Find your PC ip with ipconfig command (e.g. 192.168.2.101)
Run this command from some user's machine
git clone //192.168.2.101/projectName.git
Note: open \\192.168.2.101 in finder to see the correct path to the projectName.git (e.g. //192.168.2.101/some/path/projectName.git)
I recently ran into this error while trying to clone a repository in a remote pc to a local pc within the same LAN network.
The solution was to first make sure the drive location in the remote pc had the correct access rights for the local PC(Read/Write-which can be set using windows sharing options)
Copy the path of the remote repository. In your local pc paste the path in a windows explorer window. Then copy its directory address and paste it into any browser.
Now you should get a link with the hostname and the correct cloning URL format.
Use this link to clone the repository in the local pc.
Hope this helps.
Cheers.
"I have a few different computers that I use at home and I wanted to set up GIT that I can access my code from any of them. It took me a bit because I was too used to working with a client-server model where I designate one machine as the "server" that holds the repository and everything else was a client. Instead, GIT seems to operate more like a merge tool and every local copy is its own "master." Once I understood that, it turns out that setting up GIT is very simple and just needs GIT itself and SSH".
To read more you can check this link:
http://blog.lazyhacker.com/2010/04/setting-up-git-for-home-network.html

Resources