Nut Cloud + svn realizes remote non-LAN personal code version management

The principle is probably that the device in A is used as the server to create a warehouse, upload the warehouse to Nutstore, synchronize it to B, and then pull the code of the warehouse

Because my lab is Mac and the dormitory is win, the purpose is to pull the code of the lab back to the dormitory, so I create a warehouse with Mac , and win pulls the warehouse. Because it is a combined implementation, the installation and use of some software will not be described in detail.

Step 1: Download Nutstore and create a sync folder
Step 2: Configure Mac-side svn service

1. The configuration and use of SVN under Mac

Since the Mac comes with the server side of svn,
1. First create a new svn directory under the Nutstore synchronization directory. It is worth noting that the default Nutstore directory has Chinese characters or blank spaces. If there is a problem, you need to deal with it
Open the terminal, create a warehouse, and enter the command: svnadmin create target directory  
For example, mine is svnadmin create /user/download/nut/svn
2. Configure svn user permissions
Mainly modify the three files in the /svn/conf directory
1. Open svnserve.conf and remove # and spaces in front of the following configuration items
# anon-access = read
# auth-access = write
# password-db = passwd
# authz-db = authz
anon-access = read means that anonymous access is read-only, if changed to anon-access = none means that anonymous access is prohibited, account password is required to access
2. Open passwd, add account number and password under [users], for example:
[users]
mj =123
jj =456
The account is mj, the password is 123
3. Open authz, configure user groups and permissions
We can assign the users added in passwd to different user groups. In the future, we can set different permissions for different user groups. There is no need to set permissions for each user individually.
Add the group name and user name under [groups], separate multiple users with commas (,)
[groups]
topgroup=mj,jj
Explain that both mj and jj belong to the group topgroup, and then configure the permissions.
@topgroup= rw
The above configuration shows that all users in the topgroup group have read and write (rw) permissions to all resource libraries, and @ is used in front of the group name
If it is a user name, there is no need to add @, for example, the user mj has read and write permissions
mj = rw
As for other fine-grained permission control, you can refer to other content in the authz file or Baidu
4. Start the svn server
Enter the following command in the terminal: svnserve -d -r  /user/download/nut/svn
There is no prompt, indicating that the startup is successful
5. Close the svn server
If you want to shut down the svn server, the most effective way is to open the "Activity Monitor" in the utility
Step 3: Configure the Mac-side svn client
Cornerstone is used under MAC OSX, a visual svn management tool
1. Select: Add Repository...
2. Add Existing Repository under "file Repository", select the newly configured svn warehouse as the address
Step 4: Configure Win-side svn client
The Win side is the commonly used little turtle TortoiseSVN, create a local folder as the daily use of svn, and pull and submit the synchronized svn warehouse
But one thing worth noting is that when the little turtle uses the local warehouse as the url, it must start with file:/// and then follow the local svn warehouse, for example: file:///E :\NutCloud\My NutCloud\svnWorkspace
This is the end of the tutorial, the implementation of personal code version management under non-local area network
 
Dig a hole and study git when you have time later. After all, svn is relatively old, and git is the mainstream now
 
References:
Svn warehouse url problem under win: https://blog.csdn.net/cuiwjava/article/details/72954685
svn configuration under Mac: https://www.jianshu.com/p/3ab7e38a8630
 

Guess you like

Origin blog.csdn.net/muziyang555/article/details/108821193