SVN can use svn update path to synchronize the latest version on the server to the local device,
You can also use svn commit path to synchronize local versions to the server. However, commit only supports files that have been version controlled,
The newly added directory or file is not supported, so in order to implement this function, it took me half a day to write a bat for processing,
The implementation principle is to first find the newly added file, then add it to the version library using svn add path, and then svn commit.
Post for your reference:
Svn_commit.bat
------------------------------------------------------
@ Echo off
REM sets SVN directory
Set SVN_DB = "D: \ SHARE \ DOCUMENT \ SVN"
REM Synchronization
Svn update % SVN_DB %
REM displays the status of the files in the directory that are not commit to the temporary file, and each status row
Svn status % SVN_DB %> c: \ svn.txt
REM parses temporary files, parses various statuses, and adds newly created directories.
For/f "delims =" % I in (c: \ svn.txt) do (
Call svn_commit_one.bat "% I"
)
REM unified submission
Svn commit % SVN_DB %-m "automatic server processing"
Svn_commit_one.bat
---------------------------------------------------
REM read Parameters
SET SVN_PARA = % 1
REM read first state
SET SVN_TYPE = % SVN_PARA ~ 1, 1%
Names of Files Read by REM in subsequent states
SET SVN_FILE = "% SVN_PARA ~ 9%
REM if the status is ?, The directory is not bound. Add
IF "% SVN_TYPE %" = "? "(Svn add % SVN_FILE %)