Checkout single file (sparse checkout) in Subversion (SVN). Get single file or selected files

By neokrates, written on July 21, 2010

howto

Rate it
  • 1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
    Loading ... Loading ...
Ad
Poll
  • Most important features for perfect mp3 player are?

    • Smth. else (81%, 13 Votes)
    • Price (13%, 2 Votes)
    • Simple, good usability (13%, 2 Votes)
    • Sound quality (13%, 2 Votes)
    • Brand (cool to own new iPod) (0%, 0 Votes)
    • Design (0%, 0 Votes)
    • Cool features (DNSe, appz, etc) (0%, 0 Votes)
    • Integrates with other things (3rd party created sound system for my mp3 player) (0%, 0 Votes)
    • Physical feats (small, light, flat, etc) (0%, 0 Votes)
    • Extras (good earphones etc) (0%, 0 Votes)

    Total Voters: 16

    Vote

    Loading ... Loading ...
Feeds:
  • bodytext bodytext bodytext
Most popular search terms:
[!!] Reason, why it is not possible, is trivial: .svn metadirectory works ONLY on directory level, not for single file. That will probably change with WC-NG which does not work on per directory level.

The checkout operation is not possible on the single file (but it will be in 1.7). Still, there are at least two simple ways to get single file with subversion.

Svn before 1.7 supports only svn export on the single file:

svn export https://your.svn.host/path/to/your/file/file.name

 
[!] That is not a checkout, you just get one file. It will not be under version control.

Alternatively, you can do an empty checkout and then pick a single file you want:

svn checkout $url_of_big_dir $target_dir --depth empty
cd $target_dir
svn up $file_you_want

 
Source:
http://stackoverflow.com/questions/122107/checkout-one-file-from-subversion

 
Does that help to solve your problem?
VN:F [1.8.5_1061]
Rating: +11 (from 15 votes)
13 votes 'YES'  2 votes 'NO'

LEARN MORE (amazon bookstore)

TAGS

RELATED
Pages
Posts

SOCIAL
Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • bodytext
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • BlinkList
  • Blogosphere News
  • E-mail this story to a friend!
  • Furl
  • LinkArena
  • Live
  • MisterWong
  • Print this article!
  • StumbleUpon
  • Technorati
  • Webnews.de
  • YahooMyWeb

INCOMING SEARCH TERMS


3 Responses to “Checkout single file (sparse checkout) in Subversion (SVN). Get single file or selected files”

  1. [...] Wi?cej: Checkout single file (sparse checkout) in Subversion (SVN). Get … [...]

    Like or Dislike: Thumb up 1 Thumb down 0

  2. Karl Roberts says:

    for me this didn’t work. I’m on Cygwin (using a Windows version of svn).. I needed to do
    cd $target_dir
    svn checkout $url_of_big_dir . –depth empty
    svn up $file_you_want
    cd -

    Like or Dislike: Thumb up 0 Thumb down 0

    • admin says:

      Hey Karl,

      what version of svn do you use and what exactly was failing?

      Actually,

      svn checkout $url_of_big_dir . –depth empty

      and

      svn checkout $url_of_big_dir $target_dir –depth empty

      are equal. You just change the sequence : go into dir, checkout. Not checkout, go into dir.

      Obviously, you plan will not work if you don’t make or have $target_dir first, in my case svn creates it for you.

       

      Like or Dislike: Thumb up 0 Thumb down 0

Leave a Reply