java enhance the version control system

Both have a graphical tool, as a development process to understand

1. svn

1. Concept

1 Introduction

SVN is short for Subversion, version control system centralized management of open source code

2. Principle

The principle is the code saved to a fixed location (warehouse), each copy of the code from the location update, edit; modified code then submitted to the directory . Multiplayer collaborative development as well. Hence the need for a similar or Mysql Oracle's server for storing and managing library files (files you want to save the code, etc.) of the server --VisualSVN Server. Also requires a user operating end for submitting update detecting code , commonly used in the idea Svn plug, and TortoiseSVN (small turtles).

3. Terminology

  • repository: local warehouse, the source code unified storage
  • checkout: extraction, for the first time need to checkout the code from a repository
  • commit: commits, and modify the code needs to commit to the warehouse
  • update: updates, maintenance and warehouse code consistent

Daily development: the company -checkout- A few days later, update- modify the code, debugging good -commit

If two people modify the same file in the same line of code, suggesting that conflict, you need to manually merge, re-commit

If the file is not svn management, add to add to svn server

Local delete delete delete from the server true after commit

2. Specification

1. directory specification

The warehouse can select the directory structure of svn

Trunk to trunk directory, Branches for the development of branch directory, Tags for the releases directory

Assume complete version 1.0, you can make tags

2. branch and tag

Branches define rules: Project name + date + time Function Points

tags define rules: Project name + version number

The version number of rules: xxx.xxx.xxx first one: a revolutionary product upgrades, second: New features in version, the third: Fix bug

Read-only tags in general, can not be modified

3. Merge trunk and branches

To ensure that the latest trunk (first update), here at the branch merge

2. Git

1. the difference and svn

svn: Centralized version control systems, centralized repository on a central server. Disadvantages: poor fault-tolerant server single point of failure

Git: distributed version control system

2. Workflow

  1. Git repository cloned from a remote resource to the local warehouse
  2. Then code changes from the local repository checkout Code
  3. Before submitting the code first submitted to the staging area
  4. Submit changes to various historical versions of your local warehouse, local warehouse to save changes
  5. And other members need to share code, the code will push to a remote repository

Here Insert Picture Description

3. The work area and staging area

1. Concept

Workspace is working Directory in the computer to see the directory, such as repository

Repository: repository of directory.git

Temporary Area: repository called the stage or call the local index

In addition, there is also a first master branch Git automatically created, and the head pointer pointing to the master

Here Insert Picture Description

2. execution

git add: the file modification added to the staging area

git commit: commit changes, all content submitted to the staging area to the current branch

3. Ignore the file or folder

Creating the root of the workspace .gitignorefile, the file names to ignore fill into

4. remote repository

GitHub Create an account

ssh protocol

Secure shell Secure Shell protocol, destination: the remote management process to prevent information leaks

git bash Run generate public and private keys, public keys arranged on GitHub

After interacting see flow chart

Guess you like

Origin blog.csdn.net/wjl31802/article/details/92098014