Version management SVN, Git difference and use

1. distributed, centralized version management

     We in the development process of the project, the project will be divided into a number of stages to complete, each stage will have an output, and there will be a lot of initial results in a stage while a project is made up of many individuals to cooperate done. In order to facilitate collaboration and records the results of each stage of the people, we will use the version of the management software in the development process to achieve the related management
     we are familiar version of the controller has SVN, Git. Which SVN is centralized version management software, Git is a distributed version management software, let's look at the difference between centralized and distributed management.

Centralized Management version 1.1

      Centralized version control system, the repository is centralized on a server, you need to get the latest version from the server when you need to work, and then make changes, when completed the changes need to be pushed to a central server .
Here Insert Picture Description
      Centralized management is generally used for smaller projects, and all members are in a local area network, such use is also more convenient, LAN speed is also good, have any effect at the time the network will not upload and download.

Distributed Management version 1.2

      The main difference is distributed not require a central server, each computer is a complete repository, it can first manage their own development in their computers, when the confluence of the stage again and again to the other side, the other side you can see consistent changes.
      And compared to centralized, distributed relatively safe, everyone's computer has a complete repository, a personal computer is broken does not matter, you can charge someone else to get a complete repository of important and centralized processor there is a problem, we need to fix, in this process, everyone else can not properly upload and download.
Here Insert Picture Description

      At the same time there is a strong git branch management, can be separated from the main branch out in a development management, when this branch of work required to complete and can merge into the main line of convergence, especially when a project in multiple parallel development.

2. SVN use

Using the reference network https://www.cnblogs.com/zhoumiao/p/5459552.html

3. git use

The folder becomes a repository folder: git the init
to add files to the repository: git the Add File (. Represents all of the files to use is the same below)
to submit documents to the repository: git the commit -m "commont"
file after modification the submission also add two commands
to view the files in the current and the last submitted revised where: git diff
to see what has changed between another version: git diff commentid1 conmentid2
view the current status of work to: git status
view the version submitted by: git log --pretty = oneline
View modified version of the file: git Show file versions
prior to version recovery: git the RESET --hard (the HEAD ^ the HEAD ~ 1 ...) / the RESET --hard 1094a git with svn of updata to revision is not the same,
①, if not submitted commit git reset modify the work area and staging area will revert to the version of the reset
②, Svn if there are changes, updateto revision will not erase, but will recover with marge repository merge
③, Svn if you have to modify, update does not erase, but will merge with the repository marge restore
view themselves Modify: git reflog
Undo changes: git Checkout - the Readme.txt make the file back to the state at the time of the last git commit or git add.
To modify the staging area off of revocation (unstage), back into the work area: git the RESET the HEAD (rollback after git add)

The workspace deleted files deleted from the repository: git RM File

3.1 git workspace, the repository

Here Insert Picture Description

Workspace has a hidden directory .git, this is not the work area, but Git repository.
The Git repository saved a lot of things, most important of which is called the stage (or called index) staging area, and the first branch master Git automatically created for us, and a pointer to the master called HEAD .

      add to the staging area stage: will not be recorded version can not be restored
      commit to the workspace HEAD: do imprint, every edit records to facilitate recovery

Guess you like

Origin blog.csdn.net/weixin_43369409/article/details/90407586