How to checkout a specific Subversion revision from the command line?

后端 未结 10 594
日久生厌
日久生厌 2020-11-28 00:54

I want to checkout a specific revision of a folder in Subversion using the command line.

I don\'t see an option for specifying the revision number in TortoiseP

10条回答
  •  盖世英雄少女心
    2020-11-28 01:21

    You should never use TortoiseProc.exe as a command-line Subversion client! TortoiseProc should be utilized only for automating TortoiseSVN's GUI. See the note in TortoiseSVN's Manual:

    Remember that TortoiseSVN is a GUI client, and this automation guide shows you how to make the TortoiseSVN dialogs appear to collect user input. If you want to write a script which requires no input, you should use the official Subversion command line client instead.

    Use the Subversion command-line svn.exe client. With the command-line client, you can

    • checkout a working copy in REV revision:

      1. svn checkout --revision REV https://svn.example.com/svn/MyRepo/trunk/

      2. svn checkout https://svn.example.com/svn/MyRepo/trunk/@REV

    • update your local working copy to REV revision:

      svn update --revision REV

    • export (i.e. download) a file or a development branch in REV revision:

      1. svn export --revision REV https://svn.example.com/svn/MyRepo/trunk/

      2. svn export https://svn.example.com/MyRepo/trunk/@REV

    You may notice that with svn checkout and svn export you can enter REV number as --revision REV argument and as trailing @REV after URL. The first one is called operative revision, and the second one is called peg revision. Read SVNBook for more information about peg and operative revisions concept.

提交回复
热议问题