


Sharing of common svn commands under Linux
This article mainly shares with you common svn commands under Linux, hoping to help everyone.
1. Checkout the file to the local directory
svn checkout path (path is the directory on the server)
For example: svn checkout svn://192.168.1.1/pro/domain
Abbreviation :svn co
2. Add a new file to the repository
svn add file
For example: svn add test.php(add test.php)
svn add *.php( Add all php files in the current directory)
3. Submit the changed files to the repository
svn commit -m “LogMessage“ [-N] [--no-unlock] PATH (if selected To keep the lock, use the –no-unlock switch)
For example: svn commit -m “add test file for my test” test.php
Abbreviation: svn ci
4. Lock/ Unlock
svn lock -m “LockMessage“ [--force] PATH
For example: svn lock -m “lock test file“ test.php
svn unlock PATH
5. Update to A certain version
svn update -r m path
For example:
svn update If there is no directory after it, all files in the current directory and subdirectories will be updated to the latest version by default.
svn update -r 200 test.php (Restore the file test.php in the repository to version 200)
svn update test.php (Update, synchronize with the repository. If it prompts expiration when submitting , because of the conflict, you need to update and modify the file first, then clear svn resolved, and finally submit the commit)
Abbreviation: svn up
6. Check the file or directory status
1) svn status path (The status of files and subdirectories in the directory is not displayed in normal status)
[?: Not under the control of svn; M: The content is modified; C: Conflict occurs; A: Scheduled to be added to the repository; K: Locked 】
2) svn status -v path (display file and subdirectory status)
The first column remains the same, the second column displays the working version number, and the third and fourth columns display the last modified version number and modification people.
Note: The three commands svn status, svn diff and svn revert can also be executed without a network. The reason is that svn retains the original copy of the local version in the local .svn.
Abbreviation: svn st
7. Delete files
svn delete path -m “delete test fle”
For example: svn delete svn://192.168.1.1/pro/domain/test .php -m "delete test file"
Or directly svn delete test.php and then svn ci -m 'delete test file', it is recommended to use this
abbreviation: svn (del, remove, rm)
8. View the log
svn log path
For example: svn log test.php displays all modification records of this file and its version number changes
9. View file details
svn info path
For example: svn info test.php
10. Compare differences
svn diff path (compare the modified file with the basic version)
For example: svn diff test .php
svn diff -r m:n path (compare the differences between version m and version n)
For example: svn diff -r 200:201 test.php
Abbreviation: svn di
11. Merge the differences between the two versions into the current file
svn merge -r m:n path
For example: svn merge -r 200:205 test.php (merge the differences between versions 200 and 205 to the current file, but conflicts usually occur and need to be dealt with)
12. SVN help
svn help
svn help ci
13. Files and directories under the repository List
svn list path
Displays all files and directories belonging to the repository in the path directory
Abbreviation: svn ls
14. Create a new directory under version control
svn mkdir: Create a new directory under version control.
Usage: 1. mkdir PATH…
2. mkdir URL…
Create a directory for version control.
1. Each directory specified by the working copy PATH will be created locally, and a new
schedule will be added to wait for the next submission.
2. Each directory specified by URL will be created in the warehouse through immediate submission.
In both cases, all intermediate directories must exist beforehand.
15. Restore local modifications
svn revert: Restore the original unchanged working copy file (restore most local modifications). revert:
Usage: revert PATH…
Note: This subcommand will not access the network and will resolve the conflict. But it will not restore the
deleted directory
16. Code base URL change
svn switch (sw): Update the working copy to a different URL.
Usage:
1. switch URL [PATH]
2. switch –relocate FROM TO [PATH...]
1. Update your working copy and map it to a new URL. The behavior is very similar to "svn update", and it will also merge
files on the server with local files. This is a
method of mapping a working copy to a branch or tag in the same warehouse.
2. Rewrite the URL metadata of the working copy to reflect the simple changes in the URL. When the root URL of the warehouse changes
(such as the scheme name or host name changes), but the working copy is still mapped to the same directory in the same warehouse, use this command to update the corresponding relationship between the working copy and the warehouse.
17. Resolve conflicts
svn resolved: Remove the "conflict" status of the working copy's directory or file.
Usage: resolved PATH…
Note: This subcommand does not resolve conflicts or remove conflict markers according to the syntax; it only removes the conflicting
related files, and then allows PATH to be submitted again.
18. Output the contents of the specified file or URL.
svn cat target[@version]...If a version is specified, the search will start from the specified version.
svn cat -r PREV filename > filename (PREV is the previous version, you can also write a specific version number, so the output result can be submitted)
Related recommendations:
Detailed explanation of the steps to configure and use svn in phpstorm
Use phpstorm for svn submission
Compare two different svn branch directories in php Example analysis of the file
The above is the detailed content of Sharing of common svn commands under Linux. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



The key differences between CentOS and Ubuntu are: origin (CentOS originates from Red Hat, for enterprises; Ubuntu originates from Debian, for individuals), package management (CentOS uses yum, focusing on stability; Ubuntu uses apt, for high update frequency), support cycle (CentOS provides 10 years of support, Ubuntu provides 5 years of LTS support), community support (CentOS focuses on stability, Ubuntu provides a wide range of tutorials and documents), uses (CentOS is biased towards servers, Ubuntu is suitable for servers and desktops), other differences include installation simplicity (CentOS is thin)

How to use Docker Desktop? Docker Desktop is a tool for running Docker containers on local machines. The steps to use include: 1. Install Docker Desktop; 2. Start Docker Desktop; 3. Create Docker image (using Dockerfile); 4. Build Docker image (using docker build); 5. Run Docker container (using docker run).

CentOS has been discontinued, alternatives include: 1. Rocky Linux (best compatibility); 2. AlmaLinux (compatible with CentOS); 3. Ubuntu Server (configuration required); 4. Red Hat Enterprise Linux (commercial version, paid license); 5. Oracle Linux (compatible with CentOS and RHEL). When migrating, considerations are: compatibility, availability, support, cost, and community support.

CentOS installation steps: Download the ISO image and burn bootable media; boot and select the installation source; select the language and keyboard layout; configure the network; partition the hard disk; set the system clock; create the root user; select the software package; start the installation; restart and boot from the hard disk after the installation is completed.

Docker process viewing method: 1. Docker CLI command: docker ps; 2. Systemd CLI command: systemctl status docker; 3. Docker Compose CLI command: docker-compose ps; 4. Process Explorer (Windows); 5. /proc directory (Linux).

Docker uses Linux kernel features to provide an efficient and isolated application running environment. Its working principle is as follows: 1. The mirror is used as a read-only template, which contains everything you need to run the application; 2. The Union File System (UnionFS) stacks multiple file systems, only storing the differences, saving space and speeding up; 3. The daemon manages the mirrors and containers, and the client uses them for interaction; 4. Namespaces and cgroups implement container isolation and resource limitations; 5. Multiple network modes support container interconnection. Only by understanding these core concepts can you better utilize Docker.

Troubleshooting steps for failed Docker image build: Check Dockerfile syntax and dependency version. Check if the build context contains the required source code and dependencies. View the build log for error details. Use the --target option to build a hierarchical phase to identify failure points. Make sure to use the latest version of Docker engine. Build the image with --t [image-name]:debug mode to debug the problem. Check disk space and make sure it is sufficient. Disable SELinux to prevent interference with the build process. Ask community platforms for help, provide Dockerfiles and build log descriptions for more specific suggestions.

VS Code system requirements: Operating system: Windows 10 and above, macOS 10.12 and above, Linux distribution processor: minimum 1.6 GHz, recommended 2.0 GHz and above memory: minimum 512 MB, recommended 4 GB and above storage space: minimum 250 MB, recommended 1 GB and above other requirements: stable network connection, Xorg/Wayland (Linux)
