android-version control SVN & GIT

Source: Internet
Author: User
Tags directory create svn client svn update version control system tortoisesvn

one, the installation of virtual machines

Common virtual machine products are VMware Workstation, the VirtualBox of Oracle Corporation. Because the VMware volume phase
For the large (and certainly the powerful), and we only need the basic functions of the virtual machine, so in this document I mainly introduce the VirtualBox virtual machine.

VirtualBox: Http://pan.baidu.com/s/1gdd7FLx
Deepin Lite XP Image: Http://pan.baidu.com/s/1hqCb8Rq

Download the following software:


Install the VirtualBox just as you would install normal software. Install it and start the software later, as shown in the main interface.

Create a new virtual computer. Click the top left button. The following dialog box appears, enter a name in the dialog box, and select the operating system class
Type for Microsoft windows, version Select Windows XP (+ bit).

Click Next to enter such as interface. Here we use the recommended default memory size.

Click Next to enter such as interface. For the first creation we can directly select the "Create virtual hard disk Now" option.

Click Create to enter as interface. The default (VDI) virtual hard disk file type is used here.

Click Next to enter such as interface. We use the default (dynamic allocation) to select the physical hard disk storage method.

Click Next to enter such as interface. On the wizard page, I recommend using the default configuration for the period, which places the default virtual hard disk under the C drive, as
Fruit C disk space is not very sufficient, we can specify a directory to store the virtual hard disk.

Click Create, then our virtual machine configuration will be available temporarily, but because we have not installed the XP system CD-ROM in the virtual machine myxp,
It is therefore not available. The next step is to install the system files.

Installs the XP operating system for the created virtual machine.

Select the MYXP entry in the interface as shown, then click Start to enter the interface.

Select a virtual disc by selecting the device, and assigning optical drives in the interface. In the Open file browse directory Select our advance download good

Image file. If the system does not start automatically, then we will choose control---restart.

The following interface will appear during the installation process, we will select the default option by selecting the Enter key after the mouse focus is acquired by the virtual machine.

The above steps will take about 30 minutes and then you will see the nostalgic XP system.

2. Why Use version control

Versioning is controlled by the documentation and source code versions (each change) in the software development process (recording, tracking, comparing, merging
, etc.).

为什么使用版本控制:及时了解团队中其他成员的进度。轻松比较不同版本间的细微差别;记录每个文件成长的每步细节,利于成果的复用(reuse);资料共享,避免以往靠拷贝文件造成的版本混乱;人人为我,我为人人。所有成员维护的实际是同一个版本库,无需专人维护所有文件的最新版本;协同工作,大大提高团队工作效率,无论团队成员分布在天涯还是海角;

What are the commonly used software for version control?

CVS (rarely used) (Concurrent Version System) is a free, open source Configuration management tool with source code and installation files that can be
Download it for free. It's easy to use, powerful, cross-platform, supports concurrent versioning, and is free, and it's widely used in small and medium-sized software companies around the world. However, CVS is more complex to deploy than VSS.

SVN (Subversion), as a rewrite and an improved version of CVS, aims to replace CVS as a better version control software. In general, CVS has lost its edge in the development process and is no longer suitable for modern development, and currently, the vast majority of CVS services have switched to Svn.

ClearCase (seldom used very expensive very large) specifically is to do configuration management tools, just one of SCM management tools. is a configuration management tool developed by rational, similar to the role of Vss,cvs, but more powerful than Vss,cvs, and can be used in conjunction with WINDOWS Explorer, and can also be integrated with many development tools. However, the requirements for configuration administrators are high. and rational products are generally expensive. If you find CRACK, there is no technical support.

VSS (Microsoft software, multi-integration in Microsoft's development tools, Java programmers basically do not) (Visual Source Safe) for Microsoft's
Products, easy to learn and easy to use, using Microsoft's products for development is usually used this, but VSS can only run on the Windows platform, and is not free software, security is not high, so the application is not too extensive.

GIT (a lot of very small and powerful) is an open source distributed version control system for efficient, high-speed processing from very small to very large project version management. Git is an open source version control software developed by Linus Torvalds to help manage the development of the Linux kernel.

3. SVN Combat

Introduced version control, and now it's on the battlefield.

3.1 SVN Introduction
SVN is a version management tool that has risen in recent years and has been using SVN for almost 95% of projects in current open source projects. The SVN project was originally designed to replace CVS, the most popular version control software in the open source community, with a number of enhancements based on the functionality of CVS and a better solution to some of the shortcomings of the CVS system.

Installation of the 3.2 SVN server

VISUALSVN server is a free SVN server software. There are several versions available for download, and I will demonstrate this with the 2.5.5 version, which is slightly different from 3.0.0, but the basic functionality is basically the same.


Visualsvn-server-2.5.5.msi:http://pan.baidu.com/s/1ddtkrmx
Visualsvn-server-3.0.0-win32.msi:http://pan.baidu.com/s/1gd8fpqn
Visualsvn-server-3.0.0-x64.msi under: Http://pan.baidu.com/s/1pJv8qi3

We can install the Visualsvn-server on this machine or install the word virtual machine. In order to simulate the real development process more vividly, I installed visualsvn-server on our pre-installed virtual machines.

Note: To make it easy to copy local files directly to a virtual machine, there are two things we need to do
1) Install the Vmttransferfiles setup_host.exe locally
2) Install the Guestsetup.iso image in the virtual

Vmtransferfiles.zip:http://pan.baidu.com/s/1sjfmzup

After downloading, unzip.

Then install the Setup_host.exe first, you must first shut down the virtual machine before installation. Then start the virtual machine, install the enhancements, and then, if prompted, restart virtual
and install the Guestsetup.iso (the installation is the same as installing the XP CD-ROM).

Open the Drag and drop function. Then assign the optical drive and select Guestsetup.iso Mirror. After all of the above steps have been performed, the computer needs to be restarted. You can then implement drag-and-drop functionality for your files.

Drag the file to the virtual machine as shown in. Then double-click to start the installation. Installation is simple, there will be several wizard prompts in the middle, we use the default option of the period. Click Next until the installation is complete.

After installation, the software will automatically open the Visualsvn-server main interface as shown in.

How do I verify that it was successful after installation? Open a browser, enter in the Address bar: https://127.0.0.1, if the following interface shows that the installation was successful.

The SVN service in the local computer-side link virtual machine.
First, by setting the network card mode of the virtual machine to a bridged network card, such as. Then, in the command line of the virtual machine, enter Ipconfig to view the IP address of the current virtual machine. This IP address can be accessed by entering Https://{ip} in the browser address bar on the local computer. The first time you visit the page is the same effect. This way, our SVN service is already installed.

Create a sub-warehouse. Open Visualsvn-server in the virtual machine, right-click Repositories, and then select Create New Repository on the popup shortcut menu. As shown, enter Repository Name:mobilesafe (typically named with your own project name). then click OK.

Add users, and give permissions.
You will see the interface as shown in the first step.

Right-click Mobilesafe->properties and the following window pops up.

Click the Add button to add a user, enter a name and password in the Create New user dialog box that pops up, then click OK.

To the newly created user non-provisioning permissions, the permissions are divided into No access, Read only, read/write three kinds. Here I have assigned read/write permissions to Zhangsan. then click OK.

Use the browser to access the repository.
In the Visualsvn-server main interface, right-click the Mobilesafe Warehouse we created, then select Copy URL to Clipboard and copy the URL address to the Clipboard.

Open the browser and paste the URL address into the address bar. Open the browser to enter the user name and password, enter the following interface.

After installing the SVN server, we also need to install the client before it can be used. The installation and use of the SVN client is therefore described below.

Installation and use of 3.4 TortoiseSVN

TortoiseSVN is a free open source client of the SVN version control system, which is an SVN version-controlled Windows extension. Allows you to avoid boring and inconvenient command lines. It is fully embedded in Windows Explorer and can be used just by right-clicking in a normal window.

TortoiseSVN:
64-bit-tortoisesvn1.6.7.18415x64svn1.6.9.zip Http://pan.baidu.com/s/1o6smAoi
64-bit-tortoisesvn-1.8.8.25755-x64-svn-1.8.10.msi http://pan.baidu.com/s/1mgBn6Qk
32-bit-tortoisesvn-1.7.9.23248-win32-svn-1.7.6.msi Http://pan.baidu.com/s/1jGgj2ke
32-bit-tortoisesvn-1.8.8.25755-win32-svn-1.8.10.msi Http://pan.baidu.com/s/1o6C5xcY

We choose a software suitable for our system to download to the local.

Installation of 3.4.1 TortoiseSVN

Double-click the installer to start the Setup program, which is easy to install. Basic is click Next next to OK.

Select Accept agreement in the interface, then click Next.

Interface we use the default settings, continue to click Next. Then click Install until the installation is complete. After installation, in any place the mouse right click, you will see the following shortcut menu, then we installed successfully. If it is a lower version of the client, we may need to restart the computer to see.

3.4.2 Single-User version control

Create an empty folder on the desktop (preferably a directory), as the SVN directory, I created a directory named workspace (Note: Must be an empty directory).

Associate the directory with the SVN repository.

Right-click in the empty folder you created in the previous step, select SVN Checkout, and then enter the URL in the popup Checkout dialog, then we can copy the URL in visualsvn without entering it manually.

Click OK and the following dialog box appears, fill in the user name and password.

See the following dialog box, which indicates that the association was successful. The Mobilesafe repository in VISUALSVN has no files and, if any, is checked out to the folder we created and associated.

After being associated with the folder will be the icon will add a green white check mark. However, due to the timing of the system refresh, we may not
Can see this effect immediately, we can restart the computer, and then generally we can see the icon. There is a hidden file inside the icon. We open the system's folder options to let the hidden files and folders appear. You can see the following hidden files.

Open a. svn file home and find the following file. These files are the configuration files that are used to store data when SVN is in version control. If you delete these files, the association becomes invalid.

Create a new file, and submit to the server in the workspace directory create a new text file, open a text file to enter some content. The newly created file icon is a question mark, as shown in.

Right-click the file, select Tortoisesvn->add, and add the file to the server.

The additions here are actually planned to be added to, not really added to the server, as shown in the icons below.

Then right-click the file again and select SVN Commit as shown in. The file is actually added to the SVN server.

At the time of submission, the following dialog box will appear, in which we can enter a description of the file. Then click OK again.

After submission, the file icon is a checkmark, which is done synchronously with the server.

Modify the newly created file above and resubmit it.
Open the file above and then modify the content. The discovery icon becomes as shown. The icon indicates that the file has been modified.

After the modified file, we submit again, then the icon will become a normal green checkmark status.
The following dialog box pops up when the update is submitted.

Double-click the contents of the red box to pop up the contrasting view. With this view we can see the difference between the content of this submission and the latest version of the server, as well as editing our files again and then submitting them.

View all the version files in the SVN server.

From the Log dialog box, you can see each version of the file as well as the commit log, as shown in.

Restores (rolls back) The current file to a second version.
There are three versions of our files from the Log above. Right click on the second version, select Revert to this revision in the popup dialog, then click OK. If you just want to save the second version, then choose the Save revision to entry.

3.4.3 Backup and restore of the repository

The repository backup is simple, just copy the warehouse folder we created in the main repository into a relatively safe directory (copy to another
A computer, or even offsite backup, such as Beijing's data backup to Shanghai, so that even if the earthquake comes, do not worry about data loss.

The restoration of the repository is in fact the repository that is backed up in Visualsvn-server. It's like exporting us from eclipse to a project into another eclipse.

As shown, right-click repository-> All Tasks->import Existing Repository.

Enter the backup repository address and the new warehouse name in the dialog box that appears, as shown in.

Settlement of 3.4.4 Conflict

When more than one person changes a file at the same time, such as a first submitted, b after the submission, then B may encounter conflict issues. The exception information at the time of the conflict is as shown. The following exception information shows that the current version has expired, because A and b while downloading the file is assumed that the version number of the file is 1, and then A and B to modify the file at the same time, a modified after the commit, then each commit, the version number is added 1, this time the server file version number has become 2. When our B is changed to commit, then the B client version number is 1, and the server version number is 2 has been lower than the server version number, so reported as follows out of the date exception.

Let's try updating as prompted. Then we'll right-click the file and choose SVN Update.

When the Update occurs, the following exception appears, which is the version conflict. The version conflict icon is a yellow exclamation point.

At this point we need to right-click on the conflict file and select Tortoisesvn->edit conflicts.

Android-version control SVN & GIT

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.