svn command on mac


Mac terminal to add code to SVN
to pull code from SVN steps:
1.cd /Users/ specified path (local path)
2.svn checkout https://xxx.xxx.xx/svn/project (server path)

Submit code
1. cd /Users/ specified path (the local location where the code has been changed)
2.svn commit -m "commit log"

add
all new files
svn add * --force
add specified new files
svn add x'x/xxx (newly added files address)

delete
delete all new files
svn delete * --force

delete the specified new file
svn delete xx/xxx (address of the file to delete)

view changes to local files
svn st

create a new directory under version control
svn mkdir directory name
svn mkdir -m "Add directory remark text" http://Directory full path
Example:
svn mkdir newdir
svn mkdir -m "Making a new dir."
http://192.168.0.3/test/newdir After the directory, be sure to go back to the root directory to update, otherwise submitting files in this directory will prompt "submission failed"
svn update

If there are conflicting files, svn cleanup first


A: add, add
C: conflict, conflict
D: delete, delete
M: modify, locally modified
G: modify and merGed, local files are modified and merged with the server
U: update, update from the server
R: replace, from Server replaces
I:ignored, ignored


Among them, p means delayed resolution, which will generate 4 files (xx.txt xx.txt.mine xx.txt.r10 xx.txt.r11)
df console displays conflict information, just like using the diff command,
e directly use the system default The editor modifies the conflict
mc and uses its own file, and then uses svn resolved xx to tell the repository that I have resolved the conflict and can then submit
tc to use the files in the repository to synchronize and update the local file.
Note: At this time, the local working copy is synchronized with the repository version. , but the content of the modified file can be inconsistent, because the local file has been manually modified. Finally, the commit statement is executed, which uploads it to the codebase and increments the version number by one.

The svn command previews the file and directory structure of the version
1 svn list path
2 Displays all files and directories belonging to the version library in the path directory
3 Abbreviation: svn ls

 

Update to a certain version
1 svn update -rm path
2 For example:
3 svn update If there is no directory behind it, all files in the current directory and subdirectories will be updated to the latest version by default.
4 svn update -r 200 test.php (restore the file test.php in the repository to version 200)
5 svn update test.php (update, synchronize with the repository. If it is prompted to expire when submitting, it is because of a conflict , you need to update first, modify the file, then clear the svn resolved, and finally submit the commit)
6 Shorthand: svn up


View file or directory status
1 1) svn status path (the status of files and subdirectories in the directory, the normal status is not displayed)
2 [?: not under the control of svn; M: content modified; C: conflict; A: scheduled Add to the repository; K: locked]
3 2) svn status -v path (display file and subdirectory status)
4 The first column remains the same, the second column shows the working version number, and the third and fourth columns show the last modification The version number and who modified it.
5 Note: The three commands svn status, svn diff and svn revert can also be executed without a network, because svn keeps the original copy of the local version in the local .svn.
6 Shorthand: svn st

Delete the file
1 svn delete path -m “delete test fle”
2 For example: svn delete svn://192.168.xx/xx/xx -m “delete test file”
3 Or directly svn delete test.php and then svn ci -m 'delete test file', this 4 shorthand is recommended
: svn (del, remove, rm)

View the log
svn log path
 For example: svn log test.php Displays all modification records of this file and changes in their version numbers

View file details
1 svn info path
2 For example: svn info test.php

Compare differences
1 svn diff path (compare modified files with base version)
2 eg: svn diff test.php
3 svn diff -rm:n path (compare differences between version m and version n)
4 eg: svn diff -r 200 :201 test.php
5 shorthand: svn di

Merge the differences between the two versions into the current file
1 svn merge -rm:n path
2 For example: svn merge -r 200:205 test.php (merge the differences between versions 200 and 205 into the current file, but generally Conflicts will arise and need to be dealt with)

 

To restore local changes
1 svn revert: restore the original unchanged working copy file (restore most of the local changes). revert:
2 Usage: revert PATH…
3 Note: This subcommand does not access the network and resolves conflicts. But it won't restore
4 deleted directories

 

Resolving conflicts
1 svn resolved: Removes the "conflict" status of a directory or file from the working copy.
2 Usage: resolved PATH…
3 Note: This subcommand does not syntactically resolve conflicts or remove conflict markers; it just removes the conflicting
4 related files, and then makes the PATH available for committing again.


svn local file import svn

svn import /Users/xx/workProject/giant_trip https://192.168.xx.xx/svn/xx/trunk/giant_trip/giant_trip_client/giant_trip_client_view_pc/ -m 'start'

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324969959&siteId=291194637