CN108984413A - Branch code management method and device - Google Patents
Branch code management method and device Download PDFInfo
- Publication number
- CN108984413A CN108984413A CN201810819063.8A CN201810819063A CN108984413A CN 108984413 A CN108984413 A CN 108984413A CN 201810819063 A CN201810819063 A CN 201810819063A CN 108984413 A CN108984413 A CN 108984413A
- Authority
- CN
- China
- Prior art keywords
- source code
- service terminal
- terminal
- client terminal
- code
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/71—Version control; Configuration management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Computer Security & Cryptography (AREA)
- Stored Programmes (AREA)
Abstract
The present invention relates to Internet technical fields, more particularly to a kind of branch code management method and device, applied to client terminal, the client terminal is connect with service terminal, Version Control device is installed for managing source code on the client terminal, institute's source code of project development is stored on the service terminal.In turn, which will pull institute's source code of project development from service terminal, and store the current version number of source code, and programmer can carry out secondary development to the source code pulled on client terminal.Finally, the latest edition number of the source code stored in the current version number of the source code pulled and service terminal is compared, if inconsistent, prove that the source code in service terminal has been attached other function, and then the source code on service terminal is merged into the purpose source code of client terminal.It can be seen that in the present solution, guaranteeing the code of any one client terminal branch publication by version number, all to have an institute functional, avoids exploitation conflict.
Description
Technical field
The present invention relates to Internet technical fields, in particular to a kind of branch code management method and device.
Background technique
Many Internet companies require to be managed source code at present, and such as currently used scheme is each branch
Merging trunk after the completion of exploitation, progress trunk code is published to test environment and is tested, and it is problematic, it needs in former branch
Continual exploitation is carried out, continues to merge trunk after the completion of exploitation, be issued again until there is no problem.But multiple programmers are to identical point
When Zhi Jinhang secondary development, it is easy to cause conflict, and pulls branch every time or is required to programmer when merging trunk and carry out manually,
It is unfavorable for the development of development.
Summary of the invention
The purpose of the present invention is to provide a kind of branch code management methods, to realize automatic management source code and will not cover
Other new functions in lid source code.
Another object of the present invention is to provide a kind of Forking Proxy managing devices, with the automatic management source code of realization and not
The other function in source code can be covered.
To achieve the goals above, technical solution used in the embodiment of the present invention is as follows:
In a first aspect, being applied to client terminal, the visitor the embodiment of the invention provides a kind of branch code management method
Family terminal is connect with service terminal, Version Control device is equipped on the client terminal to manage source code, the service is eventually
Institute's source code of project development is stored on end, which comprises;The all of project development are pulled from the service terminal
Source code, and store the current version number of the source code;The operation for responding user carries out secondary development to the source code and obtains
To purpose source code;By the newest of the source code stored in the current version number of the source code of storage and the service terminal
Version number is compared, if inconsistent, the source code on the service terminal is merged into the purpose source of the client terminal
In code.
Second aspect, the embodiment of the invention also provides a kind of branch code managing devices, are applied to client terminal, described
Client terminal is connect with service terminal, and Version Control device is equipped on the client terminal to manage source code, the service
Institute's source code of project development is stored in terminal, described device includes: acquisition module, for pulling from the service terminal
Institute's source code of project development, and store the current version number of the source code;Development module, for responding the operation of user
Secondary development is carried out to the source code and obtains purpose source code;Comparison module, the source code for that will store it is current
The latest edition number of the source code stored in version number and the service terminal is compared, if inconsistent, by the service
Source code in terminal is merged into the purpose source code of the client terminal.
A kind of branch code management method provided in an embodiment of the present invention and device, are applied to client terminal, and the client is whole
End is connect with service terminal, and Version Control device is equipped on the client terminal for managing source code, is stored on the service terminal
There is institute's source code of project development.In turn, which will pull institute's source code of project development from service terminal, and
The current version number of source code is stored, programmer can carry out secondary development to the source code pulled on client terminal.Finally, will
The latest edition number of the source code stored in the current version number of the source code pulled and service terminal is compared, if different
It causes, then proves that the source code in service terminal has been attached other function, and then the source code on service terminal is merged into visitor
In the purpose source code of family terminal.It can be seen that in the present solution, each client terminal can be pulled from service terminal source code into
Row secondary development, after the source code due to servicing terminal storage every time is updated, version number will all be changed, and then work as and compare two
When the version number of person is inconsistent, source code updated in service terminal is incorporated into the purpose source code of client terminal, with
It is functional to guarantee that the code of any one client terminal branch publication all has institute, while avoiding exploitation conflict.
To enable the above objects, features and advantages of the present invention to be clearer and more comprehensible, preferred embodiment is cited below particularly, and cooperate
Appended attached drawing, is described in detail below.
Detailed description of the invention
In order to illustrate the technical solution of the embodiments of the present invention more clearly, below will be to needed in the embodiment attached
Figure is briefly described, it should be understood that the following drawings illustrates only certain embodiments of the present invention, therefore is not construed as pair
The restriction of range for those of ordinary skill in the art without creative efforts, can also be according to this
A little attached drawings obtain other relevant attached drawings.
Fig. 1 shows a kind of flow diagram of branch code management method provided in an embodiment of the present invention.
Fig. 2 shows a kind of the functional block diagrams of branch code managing device provided in an embodiment of the present invention.
Diagram: 100- branch code managing device;110- obtains module;120- development module;130- comparison module;140-
Overlay module.
Specific embodiment
Below in conjunction with attached drawing in the embodiment of the present invention, technical solution in the embodiment of the present invention carries out clear, complete
Ground description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.Usually exist
The component of the embodiment of the present invention described and illustrated in attached drawing can be arranged and be designed with a variety of different configurations herein.Cause
This, is not intended to limit claimed invention to the detailed description of the embodiment of the present invention provided in the accompanying drawings below
Range, but it is merely representative of selected embodiment of the invention.Based on the embodiment of the present invention, those skilled in the art are not doing
Every other embodiment obtained under the premise of creative work out, shall fall within the protection scope of the present invention.
It should also be noted that similar label and letter indicate similar terms in following attached drawing, therefore, once a certain Xiang Yi
It is defined in a attached drawing, does not then need that it is further defined and explained in subsequent attached drawing.Meanwhile of the invention
In description, term " first ", " second " etc. are only used for distinguishing description, are not understood to indicate or imply relative importance.
The application scenarios of the embodiment of the present invention are as follows: when Internet company carries out project development, by the source generation of all exploitations
Code is stored into service terminal, which passes through network connection with each client terminal that programmer uses.Work as programmer
When needing to carry out secondary development to source code, programmer will pull all of project development by client terminal from service terminal
Source code carries out secondary development to the source code of acquisition, and the source code after secondary development is sent in service terminal to clothes
The source code being previously stored in business terminal is updated, and then the source code stored in service terminal is referred to as trunk, by journey
Sequence person is referred to as branch from the source code that service terminal pulls progress secondary development by client terminal.
It is readily comprehensible, in the same time, it is understood that there may be multiple programmers are drawn from service terminal simultaneously by client terminal
Take source code to carry out secondary development, thereby increases and it is possible to change be same section in source code code so that being easy to cause
Conflict.And then the embodiment of the present invention provides a kind of branch code management method, realization effectively manages branch code, is avoided
Collision problem, while improving development efficiency.
General development process is related to developing environment, test environment, pre- hair ring border and production environment, and exploitation environment is journey
Sequence person pulls source code from service terminal by client terminal (such as computer) and carries out secondary development;Testing environment is in programmer
After the completion of carrying out secondary development, the split code distributed is tested;Pre- hair ring border is that code is published to publication production
Before during;The environment that production environment as actually comes into operation.
A kind of branch code management method provided in an embodiment of the present invention, is equipped with Version Control in its client terminal
Device, and then the current version number of trunk is stored when by pulling branch, when programmer carries out secondary development to the branch pulled,
Whether newest version number is consistent at present with trunk for the current version number of the trunk stored before relatively, because there are other programs
Member pulls branch and is also updated after carrying out secondary development to source code to the source code of trunk.If the source code quilt of trunk
It updates, then the version number of trunk will will increase, at this point, the current version number of the trunk stored before and trunk is current newest
Version number will be inconsistent, and then the code of trunk need to be merged into branch, with the institute on trunk when guaranteeing branch's publication
It is functional.
Scheme provided in an embodiment of the present invention preferably avoids multiple programmers while changing punching caused by code as a result,
Prominent problem.In addition, programmer may in each exploitation environment to pull branch to source code carry out secondary development, therefore,
Each exploitation environment is required to detect the version number of the source code of trunk, also i other words, in a project development process
In, it needs repeatedly to detect the version number of trunk, institute when guaranteeing that each branch is issued with trunk is functional.
A kind of branch code management method provided in an embodiment of the present invention is applied to client terminal, which can be with
It is, but is not limited to, the intelligent electronic devices such as computer.Fig. 1 is please referred to, is a kind of branch code management provided in an embodiment of the present invention
The flow diagram of method, this method comprises:
Step S110, institute's source code of project development is pulled from the service terminal, and stores working as the source code
Preceding version number.
Specifically, the client terminal where programmer is automatically whole from service when needing to carry out secondary development to source code
End pulls all source codes.Further, since be equipped with Version Control device in the client terminal, the client terminal will also storage from
The current version number for the source code that service terminal obtains, if current version number is 100.
Step S120, the operation for responding user carry out secondary development to the source code and obtain purpose source code.
I other words programmer, which can carry out secondary development to the source code pulled, obtains specific function, which compiles again
The source code of code is purpose source code.
The current version number of the source code of storage is stored source code most with the service terminal by step S130
New version number is compared, if inconsistent, the source code on the service terminal is merged into the purpose of the client terminal
In source code.
Specifically, carrying out function since each programmer of same time may pull source code from service terminal
Exploitation, therefore, will add multiple new functions added by distinct program person on the source code, in order to guarantee that branch's publication has institute
The function of thering is programmer to develop, thus need to carry out the detection of version number.I other words being encoded to obtain mesh to the branch pulled
Source code after, by the source code stored in the current version number of the source code stored when pulling branch before and service terminal
Latest edition number is compared, if inconsistent, shows that the source code stored in service terminal has been updated, i.e., by it
His programmer attached new function and be covered to the source code of storage before.It should be noted that service terminal
Source code version number it is capped will once increase predetermined value, such as become 102 from 100 before, to distinguish.Into
And the source code on service terminal is merged into the purpose source code of client terminal, so that branch can obtain in publication
Take institute functional.
In addition, the source code stored in the current version number and service terminal of the source code stored when if pulling branch before
Latest edition number it is consistent, then directly by client terminal purpose source code issue test, to carry out follow-up process.
Step S140 sends the purpose source code of the source code of the service terminal after merging and the client terminal
It is stored to the service terminal and covers the source code of historical storage in the service terminal.
Specifically, also needing the source code of service terminal after merging and the purpose source code of client terminal being sent to service
Terminal covers the source code before service terminal, so that other branches can also obtain the increased new function of current branch.
It can be seen that a kind of branch code management method provided in an embodiment of the present invention, is divided by pulling, merging automatically
Branch, simplifies operation, meanwhile, allow each branch to obtain the institute on trunk by detection version number functional, and be not easy
Cause modification to conflict, improves development efficiency.
It referring to figure 2., is a kind of functional module signal of branch code managing device 100 provided in an embodiment of the present invention
Figure, the device include obtaining module 110, development module 120, comparison module 130 and overlay module 140.
Module 110 is obtained, for pulling institute's source code of project development from the service terminal, and stores the source generation
The current version number of code.
In embodiments of the present invention, step S110 can be executed by acquisition module 110.
Development module 120, the operation for responding user carry out secondary development to the source code and obtain purpose source code.
In embodiments of the present invention, step S120 can be executed by development module 120.
Comparison module 130, for will be stored in the current version number and the service terminal of the source code of storage
The latest edition number of source code is compared, if inconsistent, the source code on the service terminal is merged into the client
In the purpose source code of terminal.
In embodiments of the present invention, step S130 can be executed by comparison module 130.
Overlay module 140, for the source code of the service terminal after merging and the purpose source of the client terminal
Code is sent to the source code that the service terminal is stored and covers historical storage in the service terminal.
In embodiments of the present invention, step S140 can be executed by overlay module 140.
Due to having been described in branch code management method part, details are not described herein.
In conclusion a kind of branch code management method provided in an embodiment of the present invention and device, are applied to client terminal,
The client terminal is connect with service terminal, Version Control device is equipped on the client terminal for managing source code, the service is whole
Institute's source code of project development is stored on end.In turn, which will pull all of project development from service terminal
Source code, and the current version number of source code is stored, programmer can carry out secondary open to the source code pulled on client terminal
Hair.Finally, the latest edition number of the source code stored in the current version number of the source code pulled and service terminal is compared
Compared with if inconsistent, proving that the source code in service terminal has been attached other function, and then by the source code on service terminal
It is merged into the purpose source code of client terminal.It can be seen that in the present solution, each client terminal can be pulled from service terminal
Source code carries out secondary development, and after the source code due to servicing terminal storage every time is updated, version number will all be changed, in turn
When the version number for comparing the two is inconsistent, source code updated in service terminal is incorporated into the purpose source generation of client terminal
In code, to guarantee that it is functional that the code of any one client terminal branch publication all has institute, while exploitation conflict is avoided.
It should be noted that, in this document, relational terms such as first and second and the like are used merely to a reality
Body or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operation
In any actual relationship or order or sequence.Moreover, the terms "include", "comprise" or its any other variant are intended to
Non-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not only wanted including those
Element, but also including other elements that are not explicitly listed, or further include for this process, method, article or equipment
Intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that
There is also other identical elements in process, method, article or equipment including the element.
The foregoing is only a preferred embodiment of the present invention, is not intended to restrict the invention, for the skill of this field
For art personnel, the invention may be variously modified and varied.All within the spirits and principles of the present invention, made any to repair
Change, equivalent replacement, improvement etc., should all be included in the protection scope of the present invention.It should also be noted that similar label and letter exist
Similar terms are indicated in following attached drawing, therefore, once being defined in a certain Xiang Yi attached drawing, are then not required in subsequent attached drawing
It is further defined and explained.
Claims (10)
1. a kind of branch code management method is applied to client terminal, the client terminal is connect with service terminal, the client
Version Control device is installed to manage source code in terminal, institute's active generation of project development is stored on the service terminal
Code, which is characterized in that the described method includes:
Institute's source code of project development is pulled from the service terminal, and stores the current version number of the source code;
The operation for responding user carries out secondary development to the source code and obtains purpose source code;
By the latest edition number of the source code stored in the current version number of the source code of storage and the service terminal into
Row compares, if inconsistent, the source code on the service terminal is merged into the purpose source code of the client terminal.
2. the method as described in claim 1, which is characterized in that the method also includes:
If consistent, the purpose source code on the client terminal is issued into test.
3. the method as described in claim 1, which is characterized in that the method also includes:
The purpose source code of the source code of the service terminal after merging and the client terminal is sent to the service eventually
End is stored and is covered the source code of historical storage in the service terminal.
4. method as claimed in claim 3, which is characterized in that version number's covering of the source code of the service terminal is primary to be increased
Add predetermined value.
5. the method as described in claim 1, which is characterized in that the project development process include exploitation environment, test environment,
Pre- hair ring border and production environment, the exploitation environment, test environment, pre- hair ring border and production environment are both needed to carry out version number
Detection.
6. a kind of branch code managing device is applied to client terminal, the client terminal is connect with service terminal, the client
Version Control device is installed to manage source code in terminal, institute's active generation of project development is stored on the service terminal
Code, which is characterized in that described device includes:
Module is obtained, for pulling institute's source code of project development from the service terminal, and stores working as the source code
Preceding version number;
Development module, the operation for responding user carry out secondary development to the source code and obtain purpose source code;
Comparison module, for will storage the source code current version number and the service terminal in the source code that stores
Latest edition number is compared, if inconsistent, the source code on the service terminal is merged into the mesh of the client terminal
Source code in.
7. device as claimed in claim 6, which is characterized in that the comparison module is also used to:
If consistent, the purpose source code on the client terminal is issued into test.
8. device as claimed in claim 6, which is characterized in that described device further include:
Overlay module is sent for the source code of the service terminal after merging and the purpose source code of the client terminal
It is stored to the service terminal and covers the source code of historical storage in the service terminal.
9. device as claimed in claim 8, which is characterized in that version number's covering of the source code of the service terminal is primary to be increased
Add predetermined value.
10. device as claimed in claim 6, which is characterized in that the project development process includes exploitation environment, test wrapper
Border, pre- hair ring border and production environment, the exploitation environment, test environment, pre- hair ring border and production environment are both needed to carry out version
This number detection.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810819063.8A CN108984413A (en) | 2018-07-24 | 2018-07-24 | Branch code management method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810819063.8A CN108984413A (en) | 2018-07-24 | 2018-07-24 | Branch code management method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN108984413A true CN108984413A (en) | 2018-12-11 |
Family
ID=64549827
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810819063.8A Pending CN108984413A (en) | 2018-07-24 | 2018-07-24 | Branch code management method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108984413A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109656621A (en) * | 2018-12-19 | 2019-04-19 | 睿驰达新能源汽车科技(北京)有限公司 | A kind of method and device merging code |
CN110362316A (en) * | 2019-07-23 | 2019-10-22 | 北京首汽智行科技有限公司 | A kind of Source code management method |
CN113900680A (en) * | 2020-07-06 | 2022-01-07 | ***通信集团重庆有限公司 | Code management method and device and computing equipment |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102682127A (en) * | 2012-05-16 | 2012-09-19 | 北京像素软件科技股份有限公司 | Data version control method |
CN105094851A (en) * | 2015-09-06 | 2015-11-25 | 浪潮软件股份有限公司 | Method for realizing code release at any time based on Git |
CN105468373A (en) * | 2015-11-23 | 2016-04-06 | 郑州悉知信息科技股份有限公司 | Branch merging method and device |
EP3076292A1 (en) * | 2015-03-31 | 2016-10-05 | AO Kaspersky Lab | System and method of controlling access of a native image of a machine code to operating system resources |
CN106371881A (en) * | 2016-09-08 | 2017-02-01 | 武汉斗鱼网络科技有限公司 | Method and system for updating program versions in servers |
CN107193607A (en) * | 2017-05-26 | 2017-09-22 | 网易(杭州)网络有限公司 | Method and apparatus, storage medium, processor and terminal for updating code file |
-
2018
- 2018-07-24 CN CN201810819063.8A patent/CN108984413A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102682127A (en) * | 2012-05-16 | 2012-09-19 | 北京像素软件科技股份有限公司 | Data version control method |
EP3076292A1 (en) * | 2015-03-31 | 2016-10-05 | AO Kaspersky Lab | System and method of controlling access of a native image of a machine code to operating system resources |
CN105094851A (en) * | 2015-09-06 | 2015-11-25 | 浪潮软件股份有限公司 | Method for realizing code release at any time based on Git |
CN105468373A (en) * | 2015-11-23 | 2016-04-06 | 郑州悉知信息科技股份有限公司 | Branch merging method and device |
CN106371881A (en) * | 2016-09-08 | 2017-02-01 | 武汉斗鱼网络科技有限公司 | Method and system for updating program versions in servers |
CN107193607A (en) * | 2017-05-26 | 2017-09-22 | 网易(杭州)网络有限公司 | Method and apparatus, storage medium, processor and terminal for updating code file |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109656621A (en) * | 2018-12-19 | 2019-04-19 | 睿驰达新能源汽车科技(北京)有限公司 | A kind of method and device merging code |
CN110362316A (en) * | 2019-07-23 | 2019-10-22 | 北京首汽智行科技有限公司 | A kind of Source code management method |
CN113900680A (en) * | 2020-07-06 | 2022-01-07 | ***通信集团重庆有限公司 | Code management method and device and computing equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104699616B (en) | The method of a kind of application test, Apparatus and system | |
US8281187B1 (en) | Unified and extensible meta-testing framework | |
CN108984413A (en) | Branch code management method and device | |
CN104254834A (en) | Cloud application deployment portability | |
US20160253163A1 (en) | Method, device, and program storage device for autonomous software life cycle management | |
CN104423960A (en) | Continuous project integration method and continuous project integration system | |
CN111294217A (en) | Alarm analysis method, device, system and storage medium | |
US10152405B2 (en) | Application testing system and method | |
CN104679500B (en) | Method and device for realizing automatic generation of entity class | |
CN106897207A (en) | Ui testing method and apparatus | |
CN105630684A (en) | Software development kit identification method and device | |
CA3050159A1 (en) | Artificial intelligence (ai) based automatic rule generation | |
CN112711438A (en) | Dependent component information extraction method, dependent component information extraction device, and computer-readable storage medium | |
WO2017095727A1 (en) | Systems and methods for software security scanning employing a scan quality index | |
CN109739526A (en) | Code update method and device | |
CN116501315A (en) | Low-code software development system, method and equipment based on DevOps domain | |
CN109120432A (en) | A kind of failed server localization method and device | |
CN107122203A (en) | The method to set up and device of a kind of configuration file | |
CN109739665A (en) | Interface managerial method, device, server and storage medium | |
US9053084B1 (en) | Self-service testing | |
CN109240696A (en) | A kind of Oftware updating method and device | |
US20200026701A1 (en) | Dynamic visualization of application and infrastructure components with layers | |
Dautriche et al. | End-user-development for smart homes: relevance and challenges | |
Behringer et al. | Towards interactive data processing and analytics-putting the human in the center of the loop | |
CN102870117B (en) | Acquisition method and apparatus for service information |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20181211 |