I am using SVN and have a repository on a remote machine. Sometimes, when working on my local machine I realize that I need to add some new files to the repo. The usual procedure I know would then be:
- at the current folder on my local machine checkout the whole SVN repo
- enter there
- copy the interesting file here
- commit
But this can be a bit tedious. I wonder if somehow, I can omit steps 1 to 3 and import the "interesting" file to SVN directly without necessity of checking out the repo first?
Perhaps svn import is what you want ? Check the documentation for details.
You can checkout only the folder where the new files go, add the new files and commit.
Seems to me like what you're doing is dangerous. If you don't update from SVN first and re-compile the code, you might be introducing bugs or break the build. Maybe the interface of that class you're using has changed in the repository!
Following worked beautifully for me:
- Log into Linux machine with the user containing access to the svn repository.
- Create a new directory e.g. "cwo_tracking" that needs to be added in svn
Now just ensure the svn tool is installed and has "import" option in it.
Run
svn import --help
Now check the complete HTTPS URL of the SVN directory under which you want to add the new file/folder e.g. https://SVN_HOST/REPO/PROJECTS/PARENT. For us it is PARENT which should have "cwo_tracking" folder added after we are done checking in.
In your present working directory containing "cwo_tracking" named empty folder, run
svn import cwo_tracking https://SVN_HOST/REPO/PROJECTS/PARENT/cwo_tracking
This should open a editor to enter comment. Put a relevant comment e.g. "Adding new dir for cwo tracking project", save and exit.
Once you save the comment it might ask you for password. If it does, Enter that and If it asks you to save your Password, type no.
It should show something like -
Committed revision 735.
Now open a Web Browser and go to the URL you typed into the import command
https://SVN_HOST/REPO/PROJECTS/PARENT/cwo_tracking
That should open a page. This is the one you added!