Examples of Common CLC Commands

A collection of information about Vault, including solutions to common problems.

Moderator: SourceGear


Posts: 9736
Joined: Tue Dec 16, 2003 1:25 pm
Location: SourceGear
PostPosted: Mon Apr 04, 2011 10:26 am
Examples of Commonly Used Vault/Vault Pro Command Line Client Commands
These assume you already have a working folder set.

The Command Line Client is the same for Vault Standard and Vault Pro. For full documentation of commands and options, see online Vault Command Line Client Help:
http://download.sourcegear.com/misc/vau ... nt/clc.htm

You can also cd to the Vault/Vault Pro Client directory on your client machine via the command line and type "vault.exe help" or "vault.exe helphtml."


ADD
C:\Program Files\SourceGear\VaultPro Client>vault ADD -host myvaultserver -user username -
password "password" -repository "RepositoryName" $/FolderABC "C:\MyFiles\Subfolder" -comment "new files for FolderABC"

CHECKOUT
C:\Program Files\SourceGear\VaultPro Client>vault CHECKOUT -host myvaultserver -user username -
password "password" -repository "RepositoryName" $/FolderABC/Subfolder/FileA.txt" -comment "this file needs updating" -exclusive

CHECKIN
C:\Program Files\SourceGear\VaultPro Client>vault CHECKIN -host myvaultserver -user username -
password "password" -repository "RepositoryName" $/FolderABC/Subfolder/FileA.txt" -comment "modified this file"

COMMIT
C:\Program Files\SourceGear\VaultPro Client>vault COMMIT -host myvaultserver -user username
-password "password" -repository "RepositoryName" $/FolderABC/Subfolder -unchanged undocheckout -comment "I modified ten files"

DIFF
C:\Program Files\SourceGear\VaultPro Client>vault DIFF -host myvaultserver -user username
-password "" -repository "RepositoryName" "$/FolderABC/Subfolder" -compareto repository -vaultdiff
"C:\Program Files\SourceGear\VaultPro Client\sgdm.exe" "$/bapp"

GET
C:\Program Files\SourceGear\VaultPro Client>vault GET -host myvaultserver -user username -
password "password" -repository "RepositoryName" $/FolderABC/Subfolder/FileA.txt" -merge overwrite -setfiletime current

GETLABEL
C:\Program Files\SourceGear\VaultPro Client>vault GETLABEL -host myvaultserver -user username -
password "password" -repository "RepositoryName" $/FolderABC "Release 1.0" -labelworkingfolder "C:\MyWorkingFolder"

Note: In certain situations, you may need to use "labelpath" in your command. For instance, if you label a folder that has subfolders with shared files, the Command Line Client may not know which shared file to retrieve.

"Labelpath" usage is described in this KB article: viewtopic.php?f=13&t=15683

GETVERSION
C:\Program Files\SourceGear\VaultPro Client>vault GETVERSION -host myvaultserver -user username -
password "password" -repository "RepositoryName" $/FolderABC/FileA.txt "5" "C:\NonWorkingFolder"

LABEL
C:\Program Files\SourceGear\VaultPro Client>vault LABEL -host myvaultserver -user username -
password "password" -repository "RepositoryName" $/FolderABC "Release 1.0"
-or-
To label a verison:

C:\Program Files\SourceGear\VaultPro Client>vault LABEL -host myvaultserver -user username -
password "password" -repository "RepositoryName" $/FolderABC "Release 1.0" 5

MOVE
C:\Program Files\SourceGear\VaultPro Client>vault MOVE -host myvaultserver -user username -password "password" -repository "RepositoryName" $/FolderABC/SubfolderABC $/FolderCDE -commit

REMEMBERLOGIN
(stores login information so you don't need to enter it every time)

C:\Program Files\SourceGear\VaultPro Client>vault REMEMBERLOGIN -host myvaultserver -user username -password "password"
(optional) -repository "RepositoryName"

RENAME
C:\Program Files\SourceGear\VaultPro Client>vault RENAME -host myvaultserver -user username -password "password" -repository "RepositoryName" $/FolderABC FolderCDE -commit

SETWORKINGFOLDER
C:\Program Files\SourceGear\VaultPro Client>vault SETWORKINGFOLDER -host myvaultserver -user username -password "password" -repository "RepositoryName" $/FolderABC "C:\MySourceCode

SHARE
C:\Program Files\SourceGear\VaultPro Client>vault share -host myvaultserver -user username -password "password" -repository "RepositoryName" $/FolderABC/File1.cs $/FolderDEF -commit

VERSIONHISTORY
C:\Program Files\SourceGear\VaultPro Client>vault VERSIONHISTORY -host myvaultserver -user username -password "password" -repository "RepositoryName" $/FolderABC -begindate 2/3/2010 -enddate 4/3/2011 -rowlimit 100
Linda Bauer
SourceGear
Technical Support Manager

Return to Knowledge Base (Vault)

Who is online

Users browsing this forum: No registered users and 1 guest

cron