online source control
back to content
sign up free version control plan

Examples (For Windows Command Line)

All examples in this section are based on the following assumptions:

Example 1: Add a folder to the repository
Example 2: Add a file to project
Example 3: Get a file
Example 4: Get file list
Example 5: Check in a file
Example 6: Check out a file
Example 7: Label a file
Example 8: Retrieve all files in a project by a label
Example 9: Share a project with another project
Example 10: Branch a shared file
Example 11: Delete a project permanently
Example 12: Put the Command Line Client in an interactive shell
Example 13: Add a file to project in an interactive shell

Example 1: Add a folder to the repository
----------------------------------------
This adds an entire folder located at "c:\projects\new" on the local machine to the project "$/123" in Dynamsoft SourceAnywhere Hosted repository.

SAWHCmd AddFolder -id 666 -username test -pwd test -repository "Dynamsoft SourceAnywhere Hosted"  -workdir c:\projects\new  -prj $/123/new -tempdir D:\temp

Example 2: Add a file to project
----------------------------------------
This adds a file "test.txt" to "$/123" project.

SAWHCmd AddFile -id 666 -username test -pwd test -repository "Dynamsoft SourceAnywhere Hosted" -workdir "c:\projects\test" -file "test.txt" -prj $/123  -tempdir "D:\temp"

Example 3: Get a file
---------------------
This places the latest version of the file "test.txt" into the working folder.

SAWHCmd GetLatestFiles -id 666 -username test -pwd test -repository "Dynamsoft SourceAnywhere Hosted" -workdir c:\projects\test -prj $/123 -file text.txt  -tempdir D:\temp

Example 4: Get file list
------------------------------
This gets the list of files in the "$/123" project.

SAWHCmd GetFileList -id 666 -username test -pwd test -repository "Dynamsoft SourceAnywhere Hosted" -prj $/123 -tempdir D:\temp

Example 5: Check in a file
---------------------------
This checks in the previously checked out file "test.txt", located on the working folder at "c:\projects\test".

SAWHCmd CheckInFile -id 666 -username test -pwd test -repository "Dynamsoft SourceAnywhere Hosted" -workdir c:\projects\test -prj $/123 -file test.txt -tempdir D:\temp  -comment "Added function HelloWorld"

Example 6: Check out a file
---------------------------
This checks out the latest version of the file "test.txt" and places it into the working folder.

SAWHCmd CheckOutFile -id 666 -username test -pwd test -repository "Dynamsoft SourceAnywhere Hosted" -workdir c:\projects\test -prj $/123 -file test.txt -tempdir D:\temp

Example 7: Label a file
--------------------------
This applies the label "Version 3" to file "test.txt" in Dynamsoft SourceAnywhere Hosted database.

SAWHCmd AddLabel -id 666 -username test -pwd test -repository "Dynamsoft SourceAnywhere Hosted"  -workdir c:\projects\test -prj $/123 -file text.txt -label "Version 3" 

Example 8: Retrieve all files in a project by a label
----------------------------------------------------------
This gets a previous version of files in a project from a label in Dynamsoft SourceAnywhere Hosted database.

SAWHCmd GetProject -id 666 -username test -pwd test -repository "Dynamsoft SourceAnywhere Hosted" -workdir c:\projects\test -prj $/123 -file text.txt -label "version 1" -tempdir D:\temp

Example 9: Share a project with another project
-----------------------------------------------
This shares the current version of the project "$/123" with the project "$/projects/Dynamsoft SourceAnywhere Hosted" in Dynamsoft SourceAnywhere Hosted repository.

SAWHCmd ShareProject -id 666 -username test -pwd test -repository "Dynamsoft SourceAnywhere Hosted" -prj $/123 -shareto $/projects/Dynamsoft SourceAnywhere Hosted -comment "Sharing project 123 into project Dynamsoft SourceAnywhere Hosted"

Example 10: Branch a shared file

----------------------------------
This branches files "test.txt" which was previously shared with another files in Dynamsoft SourceAnywhere Hosted repository.

SAWHCmd BranchFile -id 666 -username test -pwd test -repository "Dynamsoft SourceAnywhere Hosted" -prj $/123 -file test.txt

Example 11: Delete a project permanently
----------------------------------------
This deletes project "$/123" permanently from Dynamsoft SourceAnywhere Hosted repository.

SAWHCmd Delete -id 666 -username test -pwd test -repository "Dynamsoft SourceAnywhere Hosted" -prj $/123 -permanent

Example 12: Put the Command Line Client in an interactive shell

----------------------------------------

This puts the Command Line Client in an interactive shell.

SAWHCmd Interactive -id 666 -username test -pwd test -repository "Dynamsoft SourceAnywhere Hosted" -tempdir D:\temp

Example 13: Add a file to project in an interactive shell
----------------------------------------

This adds a file to project in an interactive shell.

AddFile -file "test.txt" -prj $/123

Note:

These examples are for Windows Command Line. For Java Command Line, the commands should begin with "java -jar SAWHCmd.jar" instead of "SAWHCmd" in these examples.