How to pull a new-create file from server repository by svn? - linux

I've already install subversion in my centos server.
I created a new file named "test" in server's repository.How can I pull this file to my local repository?
What I've done:
I typed svn add test ,then svn commit test in command line,and then I updated in my PC's repository,but nothing happened.
I am a newbie.Thanks in advance!

Finally.I know how the svn work.
I should create a svn repository in centos first, then add and commit that file to that repository ,and then checkout on PC.

Related

How do I put a new Git repo to an SVN server?

I have a git repo that I want to push to my SVN server. So I followed some tutorials on the web and I always end up with the same message.
$ git svn dcommit
Unable to determine upstream SVN information from HEAD history.
Perhaps the repository is empty. at /usr/libexec/git-core/git-svn line 866.
Here is the latest steps I followed
https://stackoverflow.com/a/981765/1814930
I am on Cygwin64 and the SVN server is running on Debian Wheezy.

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

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

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

Git - Syncing a Github repo with a local one?

First off, forgive me if this is a duplicate question. I don't know anything but the basic terminology, and it's difficult to find an answer just using laymen's terms.
I made a project, and I made a repository on Github. I've been able to work with that and upload stuff to it for some time, on Windows. The Github Windows application is nice, but I wish there was a GUI for the Linux git.
I want to be able to download the source for this project, and be able to edit it on my Linux machine, and be able to do git commit -m 'durrhurr' and have it upload it to the master repository.
Forgive me if you've already done most of this:
The first step is to set up your ssh keys if you are trying to go through ssh, if you are going through https you can skip this step. Detailed instructions are provided at https://help.github.com/articles/generating-ssh-keys
The next step is to make a local clone of the repository. Using the command line it will be git clone <url> The url you should be able to find on your github page.
After that you should be able to commit and push over the command line using git commit -am "commit message" and git push
You can use SmartGit for a GUI for git on Linux: http://www.syntevo.com/smartgit/index.html
But learning git first on the command line is generally a good idea:
Below are some basic examples assuming you are only working from the master branch:
Example for starting a local repo based on what you have from github:
git clone https://github.com/sampson-chen/sack.git
To see the status of the repo, do:
git status
Example for syncing your local repo to more recent changes on github:
git pull
Example for adding new or modified files to a "stage" for commit
git add /path/file1 /path/file2
Think of the stage as the files that you explicitly tell git to keep track of for revision control. git will see the all the files in the repo (and changes to tracked files), but it will only do work on the files that you add to a stage to be committed.
Example for committing the files in your "stage"
git commit
Example for pushing your local repo (whatever you have committed to your local repo) to github
git push
What you need to do is clone your git repository. From terminal cd to the directory you want the project in and do
git clone https://github.com/[username]/[repository].git
Remember not to use sudo as you will mess up the remote permissions.
You then need to commit any changes locally, i.e your git commit -m and then you can do.
git push
This will update the remote repository.
Lastly if you need to update your local project cd to the required directory and then:
git pull
To start working on the project in linux, clone the repo to linux machine. Add the ssh public key to github. Add your username and email to git-config.
For GUI you can use gitg.
PS : Get used to git cli, It is worth to spend time on it.

how to create a virtual copy of git repo on a test server

I am fairly new to Git. I have worked locally, but today i need to setup a remote machine with the git. I have no idea how.
Basically my setup is like this.
I have a windows machine which has a vmware player installed, which is used to connect to the dev ubuntu linux machine where out Git repo is situated. I putty to the dev machine and do all the operation related to git with username common to all the developers username : dev
Now there is a new rollup that is created in the dev git repo which is required to be deployed on our ubuntu linux test server. I have my account in test server. username:ash.
What are the steps that should be followed to setup this. I have some time back had a discussion with one of my colleague who had shared about using SSH key. As he is the only contact person who is not available, I have no info how to proceed. I have created the SSH key.
login to the machine as "ash".
ash#gitserver:~$
create a new directory that will contain the git-repository
ash#gitserver:~$ mkdir rollout.git
change into the directory
ash#gitserver:~$ cd rollout.git
initialize the git repository
ash#gitserver:~/rollout.git$ git init --bare
go back to your dev machine and clone the newly created repository or add it to the "remote"s of an existing git repo. use "ssh://ash#gitserver/~/rollout.git" as the remote-url.
[update for cloning]: make sure that there is not already a "rollout" directory in the directory where you want to clone to. for simplicity, create an empty directory "foo/" and try to clone into that directory. you can then move the cloned repository to wherever you want to.
push changes to the new repository.......done!
the use of ssh-keys will make authentication simpler and/or more secure but is in no ways necessary (or related) to setting up the git repository.

Resources