how to add files in svnserver using linux - linux

I am creating a svnrepository using svnadmin create svndump
In the svnsump I am creating a folder with the name trunk and importing some of my existing files.
svn import /home/somefiles/ file:///home/svndump/trunk/
But when i see trunk folder it does'nt contains any folder which are imported from somefiles folder.
but when i looked the files using svn log file:///home/svnadump/trunk/ i can see the files .
it seems files are copying but they are not adding to the repository..
how to add files to repository???
Please help me..
Thanks in Advance.

You should be using svn ls to view the contents of repository.
For adding files to repository once you have imported, the standard way is to checkout a copy, add some files using 'svn add' and them commit them to the repository.

Related

How to detach a folder from being tracked without deleting any files from it?

I completed MyProject1 and have uploaded it in git in fine way with commits after adding each new features. And now I'm starting MyProject2 and was trying to add the URL for the remote repository. But then I found out that I had mistakenly added the URL in Documents instead of MyProject1 folder because of which MyProject2 folder is also being tracked in MyProject1. And I'm not being able to add URL to MyProject2 but instead facing merge issues.
Is there any way to detach the track from my Document folder without deleting any of my files from Documents.
Structure is this way(I'm using Linux):
Documents
(And inside Documents there is:)
MyProject1
MyProject2
And other folders which are also being tracked.
We can manually do it with below steps
create a file .gitignore in base directory.
If MyProject1 and MyProject2 are already part of git tracking, Please run commands
git rm -r --cached MyProject1/
git rm -r --cached MyProject2/
Open the file in text editor and add below lines in file
MyProject1/
MyProject2/
Best way:
Create a .gitignore file following #Vinayagam R
Ignore file locally
Those methods won't affect other contributors working on the same remote repository:
Use update-index:
If you want to stop tracking a file at certian point.
git update-index --assume-unchanged yourDirectoryName
--assume-unchanged is the flag which means the files should not change locally. In other words, it is used when ignore files that you do not need to change locally (or should not change).
To revert it use update-index --no-assume-unchanged yourDirectoryName
Using .exclude
In your working directory edit .git/info/exclude

How do I get back a directory that was deleted from svn and commited

I have tried to search for a way to resolve this and have come up with nothing so far.
I made changes to certain files in a directory. I then performed an svn add and svn commit for those files I changed. Then (by accident) I deleted the directory in svn containing the files I just modified. (the directory names were different which is what caused the mix up).
My goal is to get back the directory I deleted with my modified files or get back just the modified files. I have tried using svn merge -c REV and recommitting. it first told me there was a tree conflict with the directory i deleted so i did an svn resolve --accept working PATH. I have also tried an svn merge -r (current):(previous) to no avail.
Please help. I am using Linux (centOS)

CVS add error for adding a new file

I'm trying to use CVS on my linux machine for the first time for a project, and I keep hitting my head against the same brick wall.
I have created a projects directory as /home/myuser/cvsproject
I then set the environment variable for CVS as:
export CVSROOT=/home/myuser/cvsproject
I then ran the initialize for CVS as: cvs init
This created the CVSROOT folder under my projects directory.
I then created a lower level project directory, as /home/myuser/cvsproject/project1
I added these project details in the modules file at the end as
project1 project1
I am now trying to add a new file to the repository with cvs add project1/filename.txt but I get the following error:
cvs add: in directory project1:
cvs [add aborted]: there is no version here; do 'cvs checkout' first
The file is in my current directory, located in /home/myuser/cvsproject/
If I try to add the file without the project1 prefix: cvs add filename.txt I get the same error still.
I am able to check out a file in the CVSROOT directory, i.e.
cvs checkout CVSROOT/modules so CVS is definitely working.
I appreciate any help. Thanks
CVS is not decentralised, you shouldn't make your project directory the root of CVS repository. Set CVSROOT to different place where your repository will reside (that is not the same place as your project's working directory - it should be some place new, where CVS will create its structure), then add or import everything you need (don't forget to commit). If you want another working copy, you should checkout from the same CVSROOT.

SVN - How to upload a single file?

How do I upload a single file from my local computer to a SVN repository?
I can import a directory, but I can't import a single file into existing directory.
I use SVN in linux (command line).
Any help would be appreciated.
Edit:
I forgot to mention, I need to upload this file into a specific directory that has nothing to do with directory structure in my local computer (say I upload from Desktop).
So I want to upload a file from Desktop to https://.../somefolder
This can be done as the OP requires.
svn import -m "Adding a new file" file_to_upload.ext http://example.org/path/to/repo/file_to_upload.ext
This allows uploading a file directly into the repository without checking out to a local working directory.
Well, short answer is that it doesn't work like that :)
In SVN you work with a checked-out revision of your repository. In order to "upload a single file" you have to "add" the file with "svn add foo.txt" and then run "svn commit -m "Added file foo" foo.txt". But you can only do this to an existing repository. Therefore you must first checkout the revision (rev of trunk or a given branch) of the repository to add the file to. So the entire steps would be something like
svn co https://svn.internal.foo.com/svn/mycoolgame/branches/1.81
create your new file in the correct place in the folder structure checked out.
svn add your new file
svn ci -m "added file lalalalala" you new file
After this, you can delete your local copy again.
8-year edit: As mentioned svn import can also be used to accomplish this without having a local copy under version control. Do note though that this does so recursively and will add directories not present in the repository. This could be desired behavior or a source of potential errors depending on the situation.
svn add /path/to/your/file.txt
svn ci /path/to/your/file.txt -m "This is where the message goes"
Or if you havn't added anything else just commit with
svn ci -m "Your message"
svn add filename
svn commit filename

svn overwrite- an erntire folder in repository

In svn Repository having a folder exProject.(which contains all the proj files) .
In my local machine I have my working copy also (versioned one).
How can I overwrite entire folder exProject in svn with code which I downloaded from somewhere else from my machine.
Thanks in advance
-overwrite the files on your local working copy with the files you got from somewhere else, then svn commit them.

Resources