How to copy files in an svn repo to another folder on the server - linux

Running a centos 6 server with svn repos stored on it. To deploy updates, I'd like to copy from the relevant directory within the svn repo to the appropriate /var/www website directory. Is there a simple way to do this?

Use the svn export command to do that. The subversion red book explains in detail how to do that.
When the relevant svn repo is stored under /export/svn/repo, and the part of the repository you want to copy from is /trunk/my_project/news, the whole command will be:
svn export file:///export/svn/repo/trunk/my_project/news /var/www/news

Related

Make a node project directory and SVN repository

I have a node app running on production server ~/nodeapp
I am trying to turn /username/nodeapp to an SVN repos
Since this is running on live server!! here are the steps I took
Create a repo
svnadmin create ~/nodeapp.svn
Set permission
vi ~/nodeapp.svn/conf/svnserve.conf
and add the following:
anon-access = none
auth-access = write
password-db = passwd
Import ~/nodeapp into the ~/nodeapp.svn
svn import ~/nodeapp file:///home/nodeapp.svn
Finally Rename Folders
mv ~/nodeapp ~/nodeapp.bak
mv ~/nodeapp.svn ~/nodeapp
nodeapp should now be under version control.. however pages are not loading
when I
cd ~/nodeapp && node app.js
What am I doing wrong. Why is node under SVN Repo not working
Subversion repositories are nothing like git repositories, which it looks like you're trying to emulate here. You cannot run your Node app directly out of the Subversion repository.
Instead, you need to have your repository elsewhere (on the filesystem or on a Subversion server elsewhere). Commit your code to the repository and check out a working copy to ~/nodeapp for your application to run.
You really need to read the Subversion manual, and pay special attention to the "Version Control the Subversion Way" section. Also, the FAQ entry about running a website with the code managed by Subversion may be helpful

Copying file from desktop to remote repository on SVN

I am extremely new to SVN, I am using SVN on Mac OS terminal. I have a file on my laptop that I want to transfer to my repository on my remote server.
This is what I have done:
I have checked out the repository. It says "checked out revision *".
I have used cd until the folder that I want to insert the file. So at this point I have a path like: (...../src/soln$) so I want to insert the file in the 'soln' folder.
When I try:
svn add ('...../lo.java') (the path to my file on my computer) it says:
('....../src/soln/') is not a working copy
svn import ...../lo.java it brought something weird to the screen
Please help me figure out what I am doing wrong or not doing.
The error indicates that the parent is not yet in svn. Try to svn add each folder above lo.java.
As an example if the repo root is at /path/to/my/repo and your file is in /path/to/my/repo/src/soln/lo.java then you'll not only want to svn add lo.java from inside the soln directory, but you'll also want to svn add /path/to/my/repo/src and then svn add /path/to/my/repo/src/soln before you can perform the svn add lo.java

Set SVNs working copy to public_html on cPanel server with external repos

When I do php programming, I tend to edit in-place on the (development) server (cpanel VPS, not local) via a text editor that has built in sFTP. I like this because there isn't 100 thinkgs you have to do to "publish" the changes, you save (via FTP) and reload the page.
I want to get the source into SVN mostly so I can track other people's edits.
I currently use tortoiseSVN on my windows machine to access hosted SVN repos (csvdude/codison) for non web projects so I'm familiar with that. Linux SVN, not so much.
My thought here (open to other ideas) is that I want the public_html folder on the server to be the working copy (Is there a problem with this?). People can make edits as they would via sFTP and then the working copy would be committed to the external SVN repo, possibly on a late night cron..hoping I can set it up to auto-add and commit.
So aside from thoughts on the idea, I'm curious how to set up the linux svn client to commit to external repos a la tortoiseSVN. It seems all the tutorials I see set up a local repo.
Additionally I'm worried when I check out with public_html dir as the working copy that it will overwrite everything. (yes I have backups...)
Any input or suggestions would be awesome.. Thanks.
I created a new repo on my hosted SVN service.
I manually created a public_html folder using the repo browser.
On the cPanel server:
cd /home/[account]/
svn checkout https://svnservice.com/my_repo/public_html
I set up an ignore list for directories in public_html I didn't want in the repo.
Then you can add files and directories to the repo
cd public_html
svn add [directory] // adds directory for commit
svn add --force . // adds all new files without ignoring the ignore list
In hindsight, I think the import command would have done something similar, I just didn't quite understand it enough.
This is a useful command as well:
svn status | grep '^\!' | sed 's/! *//' | xargs -I% svn rm % // removes files from repo that no longer exist in the working copy
EDIT: One thing I should mention is to make sure your .htaccess blocks access to .svn directories or it could expose source code.

How could I recover my git-daemon repositories

I had a Gitorious install that got old and it is clear now that it is not coming back. I want to recover the repos (mainly the wiki repos) from the repository. I do not want to repeat the long and painful process of setting up Gitorious again, just to get some wiki back out of it...in fact I'd like to clean up the old install soon (remove it). Although, when it was running it was awesome!
I still have the database for gitorious, so I know which .git files I want and where to find them.
I was attempting to setup git-daemon (I'm on a Linux (ubuntu) setup), but I am not having much luck. I was hopeful that maybe I could just copy the 'foo.git' file somewhere and clone it.
Currently my .git files are in user git's home folder. No problem moving them though, but I'm not sure how to go about this.
I have git daemon running, but it 'hangs up unexpectedly' if I try to connect via 'localhost', all the repos also have my 'export-ok' file in them too. I can connect accross my LAN and clone any other git initialized directory via ssh, could that help me?
Can I just copy the foo.git (more like a f13f9ed412591ce72f7b3cb793605e93ce.git) file to maybe a git initialized repo and work with it there? Is there a git tool that I could use to expand the .git file? <-- I'm sure Git would be the tool right?
The .git is a folder and not a file and git repos are lightweight in that it is just files and folders. You can copy your repo to wherever you want.
Since you said localhost, if you want you can even clone the repos with git clone /path/to/repo.git and work on the cloned repo. You do not need the daemon or anything else to be running.

Copying files from svn repository

I wanna copy files and folders from my svn repository on server, but I dont want to install svn client, can I do it without svn client?
PS server - linux (CentOS 5.5), svnadmin version 1.4.2 (r22196)compiled Aug 10 2009, 17:54:46.
UPD: files are already exported to server: I want to import files from svn repository to directory, where web-server runs. For example: svn repository located at /var/svn/repos, I wanna dump repository to /var/www, but in /var/svn/repos no files I needed.
PSS sorry for my bad english =\
The Subversion repository isn't in a readable format that you can peruse like you could with CVS. To read the files in the repository you need someone with a client somewhere.
If your Subversion repository uses Apache httpd for its server, you can use wget or curl to pull off the last revision on a specific directory since as an added bonus, the Subversion Apache httpd modules allow you to see the latest version.
$ wget http://svn/repos/foo/trunk/myfile.java
The other option is to use a Subversion repository browser like (ViewVC)[http://www.viewvc.org/] or Sventon. These will allow you to browse the entire repository (including older revisions) without having to install the Subversion client on the local machine. I like Sventon because it doesn't have to run from the Subversion repository server.
If you're on Centos 5.5, you should already have the Subversion command line client installed on your system. In that case, if you don't want the .svn directories, use the svn export command instead of svn checkout.
Or, setup your web server to ignore the .svn directories. That way, you can do an svn update and update the files on your web server without having to redownload everything.
Well, if you have physical access to the server you could use the Subversion client on that box to export files/folders and then copy them from the server to the client machine. If you're trying to do this purely from the client, the only way I can think of would be to manually download the file(s) from the web client but this will only work if you're using Apache as your Subversion server.
Unless the server has an HTTP interface (is the repository URL prefixed with http://? Just open it up in a web browser), no.
It might be simplest to export the files you want on the server (svn export file://repo/path/to/directory), then copy them to the client using http or scp or something.

Resources