How do I edit and commit a single file from a Subversion repository?

Using TortoiseSVN (a command line solution is OK too), without creating a folder on the repository side, what are the steps to checkout a single file, edit and check back in with comments?

  • Repo browser in svn “Repository moved permanently to… please relocate”
  • How does SVN 1.8 merging compare with DVCS like Git & Mercurial?
  • Using Subversion Tags to Deploy to Development/Staging/Testing Server
  • How to use “svn add” recursively in Windows console?
  • how to access subversion server remotely
  • can we use tunnelling in jenkins before connecting to the svn repository?
  • Any way to guarantee that a git user doesn't use fake account info when commiting and pushing?
  • merging changes from a maven release branch yields conflicts due to changed versions in poms
  • Setting up a project directory structure for git repo of a website
  • SVN: Create a dump file of a folder
  • Subversion: Merging a vendor's source code releases into mainline at regular intervals
  • wso2 svn update - E205011: Failure occurred processing one or more externals definitions
  • 5 Solutions collect form web for “How do I edit and commit a single file from a Subversion repository?”

    AFAIK you cannot get a copy of a single file from SVN, a working copy is always a directory. So you will need to check out a whole folder in order to edit the file in question and then commit.

    This was the case some time back (less than 3 months) and I doubt it has changed since then.

    To check out a single file, you’ll still need to check out its parent directory. From the command line, to check out

    svn co --depth empty
    svn up myfolder/index.html

    Now, you can edit and commit this file as usual, without checking out anything else.

    TortoiseSVN also includes “checkout depth” in its svn checkout menu option; however, I don’t know of a way to make Tortoise do svn up filename on a file that doesn’t exist.

    1. Right click in Windows Explorer where you want a working copy.
    2. Choose Check Out. It might be in TortoiseSVN’s menu.
    3. Enter the URL and accept to get a working copy.
    4. Make the change to the file.
    5. Right click in the working copy. Choose commit.


    Refer to Stack Overflow question Checkout one file from Subversion.

    This is possible with TortoiseSVN, but you must checkout the parent directory as well:

    1. Create a working copy of the directory with no contents (use checkout depth “Only this item”)
    2. Click on the new working copy and right click to select the repository browser (TortoiseSVN -> Repo-browser)
    3. Right click the file of choice in the repository browser and select “Update item to revision”

    You have a file single.txt you want to commit.

    The right procedure is :

    cd /path/destination_directory
    svn up
    svn commit single.txt -m "Insert here a commit message"

    Hope this will help.

    Git Baby is a git and github fan, let's start git clone.