CN106775714A - A kind of code synchronisation method and system - Google Patents

A kind of code synchronisation method and system Download PDF

Info

Publication number
CN106775714A
CN106775714A CN201611160667.3A CN201611160667A CN106775714A CN 106775714 A CN106775714 A CN 106775714A CN 201611160667 A CN201611160667 A CN 201611160667A CN 106775714 A CN106775714 A CN 106775714A
Authority
CN
China
Prior art keywords
manager
code
intermediate server
mark
project label
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.)
Granted
Application number
CN201611160667.3A
Other languages
Chinese (zh)
Other versions
CN106775714B (en
Inventor
丁鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan Douyu Network Technology Co Ltd
Original Assignee
Wuhan Douyu Network Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Wuhan Douyu Network Technology Co Ltd filed Critical Wuhan Douyu Network Technology Co Ltd
Priority to CN201611160667.3A priority Critical patent/CN106775714B/en
Publication of CN106775714A publication Critical patent/CN106775714A/en
Application granted granted Critical
Publication of CN106775714B publication Critical patent/CN106775714B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention provides a kind of code synchronisation method and system, wherein, the method includes:The synchronization notice of the first manager transmission is received, the synchronization notice carries mark, the mark of the second manager, project label and the submission daily record of the first manager;According to the mark and project label of the second manager, the corresponding item file of project label is obtained;According to the mark of the first manager, code to be synchronized is obtained from the first manager;Code to be synchronized addition is obtained into synchronous documents in item file, daily record and synchronous documents will be submitted to be sent to the second manager.The present invention adds intermediate server between the first manager and the second manager, code synchronisation between first manager and the second manager is realized by intermediate server, the code synchronisation between Git and SVN can be realized, the developer in the company using SVN is used Git as code management tools.

Description

A kind of code synchronisation method and system
Technical field
The present invention relates to communication technical field, in particular to a kind of code synchronisation method and system.
Background technology
At present, SVN (Subversion, the version control system of open source code) and Git (distributed version control systems System) it is the conventional two kinds of version control instrument of code development.
Git is the version control tool for linux kernel exploitation, by the way of distributed version storehouse, it is not necessary to service Device end software support, makes the issue of source code and exchanges extremely convenient.SVN employs branch management system, for how personal common With the same project of exploitation, the how personal common source of the same project of exploitation is realized.For the exploit person for being familiar with code development For member, the flexibility of Git and versatility are that SVN can not compare.Many developer Git accustomed to using carry out dematron Reason, but many companies are all to use SVN as code management tools, and current Git and SVN cannot realize synchronizing code pipe Reason, so causes that management code cannot be carried out using Git using the developer of the company of SVN.
Therefore it is badly in need of a kind of code synchronisation scheme, to realize the code synchronisation between Git and SVN, makes to manage generation using SVN Developer in the company of code can use Git as code management tools.
The content of the invention
In view of this, the purpose of the embodiment of the present invention is to provide a kind of code synchronisation method and system, in the first management Intermediate server is added between device and the second manager, is realized between the first manager and the second manager by intermediate server Code synchronisation, the code synchronisation between Git and SVN can be realized, use the developer in the company using SVN Git is used as code management tools.
In a first aspect, the embodiment of the invention provides a kind of code synchronisation method, methods described includes:
The synchronization notice of the first manager transmission is received, the synchronization notice carries the mark of the first manager, the second pipe Manage mark, project label and the submission daily record of device;
According to the mark and the project label of second manager, the corresponding project text of the project label is obtained Part;
According to the mark of first manager, code to be synchronized is obtained from first manager;
The code to be synchronized addition is obtained into synchronous documents in the item file, by the submission daily record and described Synchronous documents are sent to second manager.
With reference in a first aspect, the embodiment of the invention provides the first possible implementation of above-mentioned first aspect, its In, the mark and the project label according to second manager obtains the corresponding item file of the project label, Including:
According to the project label, judge to whether there is the corresponding item file of the project label in local memory;
If it is, directly obtaining the corresponding item file of the project label from local memory;
If it is not, then according to the mark of second manager, send and obtain request to second manager, it is described to obtain Take request and carry the project label, receive the corresponding item file of the project label that second manager sends.
With reference in a first aspect, the embodiment of the invention provides second possible implementation of above-mentioned first aspect, its In, before the synchronization notice for receiving the transmission of the first manager, also include:
Generation digital certificate, the digital certificate is used to be communicated with the first manager and the second manager;
Perform authority and assign instruction, obtain the access limit of local file.
With reference in a first aspect, the embodiment of the invention provides the third possible implementation of above-mentioned first aspect, its In, methods described also includes:
Every preset time period, the project label and item file of each project are obtained from second manager, stored The project label of each project and the corresponding relation of item file.
With reference to any one implementation in the first to the third possible implementation of first aspect or first aspect, The 4th kind of possible implementation of above-mentioned first aspect is the embodiment of the invention provides, wherein,
First manager is distributed version control system Git managers, and second manager is open-source generation The version control system SVN managers of code;Or,
First manager is SVN managers, and second manager is Git managers.
Second aspect, the embodiment of the invention provides a kind of code synchronisation method, and methods described includes:
Synchronization notice is sent to intermediate server, the synchronization notice carries mark, second manager of the first manager Mark, project label and submit to daily record;
When the acquisition for receiving the intermediate server acquisition code is asked, transmission code to be synchronized is given in the middle of described and is taken Business device, so that the intermediate server is by the code synchronisation to be synchronized to second manager.
With reference to second aspect, the first possible implementation of above-mentioned second aspect is the embodiment of the invention provides, its In, methods described also includes:
When the acquisition for receiving the carrying project label that the intermediate server sends is asked, the project label is sent Corresponding item file gives the intermediate server;
Receive the synchronous documents that the intermediate server sends.
With reference to the first possible implementation of second aspect or second aspect, above-mentioned is the embodiment of the invention provides Second possible implementation of two aspects, wherein,
First manager is Git managers, and second manager is SVN managers;Or,
First manager is SVN managers, and second manager is Git managers.
The third aspect, the embodiment of the invention provides a kind of code synchronisation system, the system include the first manager, in Between server and the second manager;
First manager, for sending synchronization notice to the intermediate server, when receiving the intermediary service When the acquisition that device obtains code is asked, code to be synchronized is transmitted to the intermediate server, the synchronization notice carries first and manages Manage mark, the mark of the second manager, project label and the submission daily record of device;
The intermediate server, for receiving the synchronization notice, according to the mark and the item of second manager Target is known, and obtains the corresponding item file of the project label;According to the mark of first manager, from the described first management Device obtains code to be synchronized;The code addition to be synchronized is obtained into synchronous documents in the item file, by the submission Daily record and the synchronous documents are sent to second manager;
Second manager, for when the acquisition request for receiving the carrying project label that the intermediate server sends When, the corresponding item file of the project label is sent to the intermediate server;Receive the institute that the intermediate server sends State synchronous documents.
With reference to the third aspect, the first possible implementation of the above-mentioned third aspect is the embodiment of the invention provides, its In,
First manager is Git managers, and second manager is SVN managers;Or,
First manager is SVN managers, and second manager is Git managers.
In method and system provided in an embodiment of the present invention, the synchronization notice that the first manager sends, the synchronization are received Notify mark, the mark of the second manager, project label and the submission daily record of the first manager of carrying;According to the second manager Mark and project label, obtain the corresponding item file of project label;According to the mark of the first manager, obtained from the first manager Take code to be synchronized;Code to be synchronized addition is obtained into synchronous documents in item file, daily record and synchronous documents hair will be submitted to Give the second manager.The present invention adds intermediate server between the first manager and the second manager, by intermediary service Device realizes the code synchronisation between the first manager and the second manager, can realize the code synchronisation between Git and SVN, makes Git can be used as code management tools using the developer in the company of SVN.
To enable the above objects, features and advantages of the present invention to become apparent, preferred embodiment cited below particularly, and coordinate Appended accompanying drawing, is described in detail below.
Brief description of the drawings
Technical scheme in order to illustrate more clearly the embodiments of the present invention, below will be attached to what is used needed for embodiment Figure is briefly described, it will be appreciated that the following drawings illustrate only certain embodiments of the present invention, thus be not construed as it is right The restriction of scope, for those of ordinary skill in the art, on the premise of not paying creative work, can also be according to this A little accompanying drawings obtain other related accompanying drawings.
Fig. 1 shows a kind of flow chart of code synchronisation method that the embodiment of the present invention 1 is provided;
Fig. 2 shows the system architecture diagram of code synchronisation between a kind of Git that the embodiment of the present invention 1 provided and SVN;
Fig. 3 shows a kind of flow chart of code synchronisation method that the embodiment of the present invention 2 is provided;
Fig. 4 shows a kind of flow chart of code synchronisation method that the embodiment of the present invention 3 is provided;
Fig. 5 shows a kind of structural representation of code synchronisation system that the embodiment of the present invention 4 is provided.
Specific embodiment
To make the purpose, technical scheme and advantage of the embodiment of the present invention clearer, below in conjunction with the embodiment of the present invention Middle accompanying drawing, is clearly and completely described to the technical scheme in the embodiment of the present invention, it is clear that described embodiment is only It is a part of embodiment of the invention, rather than whole embodiments.The present invention generally described and illustrated in accompanying drawing herein is real The component for applying example can be arranged and designed with a variety of configurations.Therefore, it is of the invention to what is provided in the accompanying drawings below The detailed description of embodiment is not intended to limit the scope of claimed invention, but is merely representative of selected reality of the invention Apply example.Based on embodiments of the invention, the institute that those skilled in the art are obtained on the premise of creative work is not made There is other embodiment, belong to the scope of protection of the invention.
Cannot realize that synchronizing code is managed in view of Git in correlation technique and SVN, cause the exploitation of the company for using SVN Personnel cannot carry out management code using Git.Based on this, a kind of code synchronisation method and system are the embodiment of the invention provides, under Face is described by embodiment.
Embodiment 1
The embodiment of the invention provides a kind of code synchronisation method.
The system that the method is based on includes the first manager, intermediate server and the second manager, just because of the With the addition of intermediate server between one manager and the second manager, can realize the first manager and the second manager it Between code synchronisation.Before code synchronisation operation is carried out, intermediate server needs to generate digital certificate, and the digital certificate is used for Communicated with the first manager and the second manager.After intermediate server generation digital certificate, by digital certificate configuration On the first manager and the second manager.Each intermediate server is led to the first manager and the second manager afterwards The digital certificate is all carried during letter, by carrying out certificate communication between the digital certificate and the first manager and the second manager, Both the safety of the first manager and the second manager had been ensured, intermediate server and the first manager and the second management can have been ensured again Can be with normal communication between device.
During code synchronisation is carried out, intermediate server needs to be written and read local file, therefore by above-mentioned Before system carries out code synchronisation, intermediate server also performs authority and assigns instruction, obtains the access limit of local file.
First manager and the second manager all possess hook (hook) function, and the first manager and the second manager pass through Hook functions are set up and the communication connection between intermediate server.First manager and the second manager all possess hook foundation Device, before code synchronisation is carried out by said system, by the hook builders on the first manager in the first manager Hook is set up, and hook is set up in the second manager by the hook builders on the second manager.
Above-mentioned intermediate server generates digital certificate, and by digital certificate configuration in the first manager and the second manager On, and intermediate server is assigned to the access limit of local file, and build on the first manager and the second manager respectively After vertical hook, the code synchronisation system being made up of the first manager, intermediate server and the second manager is just established.Base In the code synchronisation system set up, the first manager and the second management can be realized by method provided in an embodiment of the present invention Code synchronisation between device.
Wherein, intermediate server can be serviced for PHP (Hypertext Preprocessor, HyperText Preprocessor) Device.First manager is Git managers, and the second manager is SVN managers.Or, the first manager is SVN managers, the Two managers are Git managers.The embodiment of the present invention can realize the code synchronisation between Git and SVN, make developer without The code management tools that scruple company is used, can select the code management tools for oneself getting used to.
Referring to Fig. 1, the method specifically includes following steps:
Step 101:First manager sends synchronization notice to intermediate server, and the synchronization notice carries the first manager Mark, the mark of the second manager, project label and submission daily record.
In embodiments of the present invention, the code management tools that the first manager is used by developer, open for one Hair project, when developer writes out new code, these new codes are code to be synchronized.Developer is treated writing While synchronizing code, the corresponding submission daily record of code to be synchronized can be also write, generation to be synchronized can be included in the submission daily record Code is corresponding to write the information such as purpose.
After developer has write code to be synchronized and corresponding submission daily record, code to be synchronized and submission daily record are uploaded To the first manager.The code that developer can be provided by the first manager submits to interface to upload code to be synchronized and submission Daily record, it is also possible to by writing submiting command by code to be synchronized and submitting to daily record to be uploaded to the first manager.
When developer writes out code to be synchronized and submits daily record to, and by code to be synchronized and daily record is submitted to be uploaded to the During one manager, the first manager sends synchronization notice to intermediate server by the hook of itself, and the synchronization notice carries the The mark of one manager, the mark of the second manager, project label and submission daily record.Wherein, the mark of the first manager can be with It is the address of the first manager or equipment Serial Number etc., the mark of the second manager can be address or the equipment of the second manager Sequence number etc., project label can be the project name of the above-mentioned affiliated project of code to be synchronized.
In embodiments of the present invention, above-mentioned synchronization notice be one section of json (javaScript object notation, gently Magnitude data interchange format) character string.
After first manager sends above-mentioned synchronization notice to intermediate server, intermediate server first passes through following steps 102- 106 operation, the item file of the affiliated project of code to be synchronized is obtained according to the mark and project label of the second manager, Obtain the corresponding item file of project label that synchronization notice is carried.
Step 102:Intermediate server receives the synchronization notice that the first manager sends, according to the item that the synchronization notice is carried Target is known, and judges to whether there is the corresponding item file of the project label in local memory, if it is, step 103 is performed, such as It is really no, then perform step 104.
In embodiments of the present invention, whether intermediate server performs oracle listener, monitors receive the first manager in real time Or second manager send information.When the first manager sends synchronization notice to intermediate server, the prison of intermediate server Program is listened to listen to the synchronization notice, the synchronization notice is to include mark, the mark of the second manager, the project of the first manager Mark and the json character strings of submission daily record.Intermediate server calls decoding functions json_decode () by the json character strings Be converted to json objects.Code synchronisation operation is carried out subsequently through the json objects are called.
After intermediate server obtains above-mentioned synchronization notice, according to the project label that synchronization notice is carried, local memory is checked The project label of middle storage item file corresponding with whether there is the project label in the corresponding relation of item file.
Step 103:Intermediate server directly obtains the corresponding item file of the project label from local memory, then holds Row step 107.
Step 104:The mark of the second manager that intermediate server is carried according to synchronization notice, sends and obtains request to the Two managers, acquisition request carries the project label.
When in middle server local internal memory in the absence of the project label corresponding item file, intermediate server need to be from Second manager obtains the corresponding item file of the project label.
Step 105:Second manager receives the acquisition request that intermediate server sends, and sends the corresponding item of the project label Mesh file is to intermediate server.
Second manager receives above-mentioned acquisition request, according to the project label that acquisition request is carried, from project label with Corresponding item file is obtained in the corresponding relation of item file, the item file of acquisition is returned into intermediate server.
Step 106:Intermediate server receives the corresponding item file of project label that the second manager sends.
In embodiments of the present invention, it is assumed that the second manager is SVN managers, then intermediate server is by performing function Exec (" svn checkout path ") obtains item file.Wherein, path (path) is then second that synchronization notice is carried The mark of manager.
Ensure there is the corresponding item of project label in intermediate server local memory by the operation of above-mentioned steps 102-106 After mesh file, 107-109 obtains code to be synchronized to intermediate server from the first manager as follows.
Step 107:Intermediate server sends the acquisition for obtaining code and asks to according to the mark of the first manager One manager.
Step 108:First manager receives acquisition request, transmits code to be synchronized to intermediate server.
In embodiments of the present invention, it is assumed that the first manager is Git managers, then intermediate server gets item file Afterwards, then perform function exec (" git clone ... ") and obtain code to be synchronized to perform.
Step 109:Intermediate server receives the code to be synchronized of the first manager transmission, by code to be synchronized addition in item Synchronous documents are obtained in mesh file.
In embodiments of the present invention, after intermediate server gets code to be synchronized from the first manager, by generation to be synchronized Code addition realizes that the item code on the code and the second manager of the developer on the first manager is closed in item file And, obtain synchronous documents.
Assuming that the first manager is Git managers, then performs function exec (" git pull ") and add code to be synchronized To in item file.
Step 110:Intermediate managers will submit to daily record and synchronous documents to be sent to the second manager.
Intermediate managers are according to the mark of the second manager, the submission daily record that synchronization notice is carried and above-mentioned synchronous documents It is sent to the second manager.
Assuming that the second manager is SVN managers, then intermediate server execution function exec (" svn commit* ") will be upper State synchronous documents to be submitted in SVN storehouses, function exec (" svn commit-m " submission daily record ") is then performed again, will be synchronous logical Know that the submission daily record of carrying is submitted in SVN storehouses.
Step 111:Second manager receives the synchronous documents that intermediate server sends.
Realize in the code synchronisation to be synchronized on the first manager to the second manager through the above way.The present invention Can also now be managed in the code synchronisation to be synchronized in the second manager to the first manager equivalent to first in embodiment Device and the second manager identity are exchanged, the operation of the second manager the first manager of execution originally, the first manager originally Perform the operation of the second manager.
In embodiments of the present invention, in order to avoid the operation of step 104-106, the speed of code synchronisation, centre clothes are accelerated Business device can also obtain the project label and item file of each project from the second manager every preset time period, and storage is every The project label of individual project and the corresponding relation of item file.So that it is guaranteed that it is to be synchronized to be stored with intermediate server local memory The item file of the affiliated project of code, and then item file is obtained from the second manager temporarily when avoiding code synchronisation, improve generation Code synchronous efficiency.
As shown in Fig. 2 the embodiment of the present invention can realize the code synchronisation between Git managers and SVN managers, Add PHP servers between Git managers and SVN managers to be monitored, developer submits code to be synchronized to Git, SVN to Manager carries out public administration.
In embodiments of the present invention, the synchronization notice that the first manager sends is received, the synchronization notice carries first and manages The mark of device, the mark of the second manager, project label and submission daily record;According to the mark and project label of the second manager, Obtain the corresponding item file of project label;According to the mark of the first manager, code to be synchronized is obtained from the first manager;Will Code addition to be synchronized obtains synchronous documents in item file, and daily record and synchronous documents will be submitted to be sent to the second manager. The present invention adds intermediate server between the first manager and the second manager, and the first manager is realized by intermediate server With the code synchronisation between the second manager, the code synchronisation between Git and SVN can be realized, in making the company using SVN Developer can use Git as code management tools.
Embodiment 2
Referring to Fig. 3, a kind of code synchronisation method is the embodiment of the invention provides, the executive agent of the method is above-mentioned implementation Example 1 provides the intermediate server in code synchronisation method, and the method specifically includes following steps:
Step 201:Receive the first manager transmission synchronization notice, the synchronization notice carry the first manager mark, The mark of the second manager, project label and submit daily record to.
Step 202:According to the mark and project label of the second manager, the corresponding item file of project label is obtained.
Step 203:According to the mark of the first manager, code to be synchronized is obtained from the first manager.
Step 204:Code to be synchronized addition is obtained into synchronous documents in item file, daily record and synchronous documents will be submitted to It is sent to the second manager.
Above-mentioned mark and project label according to the second manager, obtains the corresponding item file of project label, including:
According to project label, judge to whether there is the corresponding item file of project label in local memory;
If it is, directly obtaining item file from local memory;
If it is not, then according to the mark of the second manager, sending and obtaining request to the second manager, obtain request and carry item Target is known, and receives the corresponding item file of project label that the second manager sends.
In embodiments of the present invention, before receiving the synchronization notice that the first manager sends, also include:
Generation digital certificate, digital certificate is used to be communicated with the first manager and the second manager;
Perform authority and assign instruction, obtain the access limit of local file.
In order to avoid obtaining item file from the second manager temporarily, also every preset time period in the embodiment of the present invention, The project label and item file of each project are obtained from the second manager, the project label and item file of each project is stored Corresponding relation.
In embodiments of the present invention, the first manager is Git managers, and the second manager is SVN managers;Or, the One manager is SVN managers, and the second manager is Git managers.
In embodiments of the present invention, the synchronization notice that the first manager sends is received, the synchronization notice carries first and manages The mark of device, the mark of the second manager, project label and submission daily record;According to the mark and project label of the second manager, Obtain the corresponding item file of project label;According to the mark of the first manager, code to be synchronized is obtained from the first manager;Will Code addition to be synchronized obtains synchronous documents in item file, and daily record and synchronous documents will be submitted to be sent to the second manager. The present invention adds intermediate server between the first manager and the second manager, and the first manager is realized by intermediate server With the code synchronisation between the second manager, the code synchronisation between Git and SVN can be realized, in making the company using SVN Developer can use Git as code management tools.
Embodiment 3
Referring to Fig. 4, a kind of code synchronisation method is the embodiment of the invention provides, the executive agent of the method is embodiment 1 The first manager in the code synchronisation method for being provided, the method specifically includes following steps:
Step 301:Synchronization notice is sent to intermediate server, the synchronization notice carries mark, second of the first manager The mark of manager, project label and submit daily record to.
Step 302:When the acquisition for receiving intermediate server acquisition code is asked, code to be synchronized is transmitted to middle clothes Business device, so that intermediate server is by code synchronisation to be synchronized to the second manager.
Through the above way by the code synchronisation to be synchronized in the first manager to the second manager.The embodiment of the present invention In can also be by the code synchronisation to be synchronized in the second manager to the first manager, now the second manager performs above-mentioned step Rapid 301 and 302 operation, and the first manager is when the acquisition request of the carrying project label for receiving intermediate server transmission When, the corresponding item file of project label is sent to intermediate server;Receive the synchronous documents that intermediate server sends.
In embodiments of the present invention, the first manager is Git managers, and the second manager is SVN managers;Or, the One manager is SVN managers, and the second manager is Git managers.
In embodiments of the present invention, the synchronization notice that the first manager sends is received, the synchronization notice carries first and manages The mark of device, the mark of the second manager, project label and submission daily record;According to the mark and project label of the second manager, Obtain the corresponding item file of project label;According to the mark of the first manager, code to be synchronized is obtained from the first manager;Will Code addition to be synchronized obtains synchronous documents in item file, and daily record and synchronous documents will be submitted to be sent to the second manager. The present invention adds intermediate server between the first manager and the second manager, and the first manager is realized by intermediate server With the code synchronisation between the second manager, the code synchronisation between Git and SVN can be realized, in making the company using SVN Developer can use Git as code management tools.
Embodiment 4
Referring to Fig. 5, a kind of code synchronisation system is the embodiment of the invention provides, the system is used to perform above-described embodiment 1 The code synchronisation method for being provided.The system includes the first manager 401, the manager 403 of intermediate server 402 and second;
First manager 401, for sending synchronization notice to intermediate server 402, obtains when intermediate server 402 is received When replacing the acquisition of code to ask, code to be synchronized is transmitted to intermediate server 402, synchronization notice carries the first manager 401 Mark, the mark of the second manager 403, project label and submission daily record;
Intermediate server 402, for receiving synchronization notice, according to the mark and project label of the second manager 403, obtains The corresponding item file of project label;According to the mark of the first manager 401, code to be synchronized is obtained from the first manager 401; Code to be synchronized addition is obtained into synchronous documents in item file, daily record and synchronous documents will be submitted to be sent to the second manager 403;
Second manager 403, for when the acquisition request of the carrying project label for receiving the transmission of intermediate server 402 When, the corresponding item file of project label is sent to intermediate server 402;Receive the synchronous documents that intermediate server 402 sends.
First manager 401 is Git managers, and the second manager 403 is SVN managers;Or, the first manager 401 It is SVN managers, the second manager 403 is Git managers.
In the embodiment of the present invention, the first manager 401, the manager 403 of intermediate server 402 and second concrete operations it is thin The operation saved respectively with the first manager, intermediate server and the second manager mentioned in embodiment 1 is identical, herein no longer Repeat.
In embodiments of the present invention, the synchronization notice that the first manager sends is received, the synchronization notice carries first and manages The mark of device, the mark of the second manager, project label and submission daily record;According to the mark and project label of the second manager, Obtain the corresponding item file of project label;According to the mark of the first manager, code to be synchronized is obtained from the first manager;Will Code addition to be synchronized obtains synchronous documents in item file, and daily record and synchronous documents will be submitted to be sent to the second manager. The present invention adds intermediate server between the first manager and the second manager, and the first manager is realized by intermediate server With the code synchronisation between the second manager, the code synchronisation between Git and SVN can be realized, in making the company using SVN Developer can use Git as code management tools.
The technique effect and preceding method embodiment phase of the system that the embodiment of the present invention is provided, its realization principle and generation Together, to briefly describe, system embodiment part does not refer to part, refers to corresponding contents in preceding method embodiment.Affiliated neck The technical staff in domain can be understood that, for convenience and simplicity of description, the specific work process of system described above, The corresponding process in above method embodiment is may be referred to, be will not be repeated here.
In embodiment provided by the present invention, it should be understood that disclosed system and method, can be by other sides Formula is realized.System embodiment described above is only schematical, for example, the division of the unit, only one kind are patrolled Collect function to divide, there can be other dividing mode when actually realizing, but for example, multiple units or component can combine or can To be integrated into another system, or some features can be ignored, or not perform.It is another, it is shown or discussed each other Coupling or direct-coupling or communication connection can be the INDIRECT COUPLING or communication link of device or unit by some communication interfaces Connect, can be electrical, mechanical or other forms.
The unit that is illustrated as separating component can be or may not be it is physically separate, it is aobvious as unit The part for showing can be or may not be physical location, you can with positioned at a place, or can also be distributed to multiple On NE.Some or all of unit therein can be according to the actual needs selected to realize the mesh of this embodiment scheme 's.
In addition, during each functional unit in the embodiment that the present invention is provided can be integrated in a processing unit, also may be used Being that unit is individually physically present, it is also possible to which two or more units are integrated in a unit.
If the function is to realize in the form of SFU software functional unit and as independent production marketing or when using, can be with Storage is in a computer read/write memory medium.Based on such understanding, technical scheme is substantially in other words The part contributed to prior art or the part of the technical scheme can be embodied in the form of software product, the meter Calculation machine software product is stored in a storage medium, including some instructions are used to so that a computer equipment (can be individual People's computer, server, or network equipment etc.) perform all or part of step of each embodiment methods described of the invention. And foregoing storage medium includes:USB flash disk, mobile hard disk, read-only storage (ROM, Read-Only Memory), arbitrary access are deposited Reservoir (RAM, Random Access Memory), magnetic disc or CD etc. are various can be with the medium of store program codes.
It should be noted that:Similar label and letter represents similar terms in following accompanying drawing, therefore, once a certain Xiang Yi It is defined in individual accompanying drawing, then it need not be further defined and explained in subsequent accompanying drawing, additionally, term " the One ", " second ", " the 3rd " etc. are only used for distinguishing description, and it is not intended that indicating or implying relative importance.
Finally it should be noted that:Embodiment described above, specific embodiment only of the invention, is used to illustrate the present invention Technical scheme, rather than its limitations, protection scope of the present invention is not limited thereto, although with reference to the foregoing embodiments to this hair It is bright to be described in detail, it will be understood by those within the art that:Any one skilled in the art The invention discloses technical scope in, it can still modify to the technical scheme described in previous embodiment or can be light Change is readily conceivable that, or equivalent is carried out to which part technical characteristic;And these modifications, change or replacement, do not make The essence of appropriate technical solution departs from the spirit and scope of embodiment of the present invention technical scheme.Should all cover in protection of the invention Within the scope of.Therefore, protection scope of the present invention should be based on the protection scope of the described claims.

Claims (10)

1. a kind of code synchronisation method, it is characterised in that methods described includes:
The synchronization notice of the first manager transmission is received, the synchronization notice carries mark, second manager of the first manager Mark, project label and submit to daily record;
According to the mark and the project label of second manager, the corresponding item file of the project label is obtained;
According to the mark of first manager, code to be synchronized is obtained from first manager;
The code addition to be synchronized is obtained into synchronous documents in the item file, by submission daily record and the synchronization File is sent to second manager.
2. method according to claim 1, it is characterised in that the mark and the item according to second manager Target is known, and obtains the corresponding item file of the project label, including:
According to the project label, judge to whether there is the corresponding item file of the project label in local memory;
If it is, directly obtaining the corresponding item file of the project label from local memory;
If it is not, then according to the mark of second manager, sending and obtaining request to second manager, the acquisition please The carrying project label is sought, the corresponding item file of the project label that second manager sends is received.
3. method according to claim 1, it is characterised in that the synchronization notice that the manager of the reception first sends it Before, also include:
Generation digital certificate, the digital certificate is used to be communicated with the first manager and the second manager;
Perform authority and assign instruction, obtain the access limit of local file.
4. method according to claim 1, it is characterised in that methods described also includes:
Every preset time period, the project label and item file of each project are obtained from second manager, storage is described The project label of each project and the corresponding relation of item file.
5. the method according to claim any one of 1-4, it is characterised in that
First manager is distributed version control system Git managers, and second manager is open source code Version control system SVN managers;Or,
First manager is SVN managers, and second manager is Git managers.
6. a kind of code synchronisation method, it is characterised in that methods described includes:
Synchronization notice is sent to intermediate server, the synchronization notice carries mark, the mark of the second manager of the first manager Knowledge, project label and submission daily record;
When the acquisition for receiving the intermediate server acquisition code is asked, code to be synchronized is transmitted to the intermediary service Device, so that the intermediate server is by the code synchronisation to be synchronized to second manager.
7. method according to claim 6, it is characterised in that methods described also includes:
When the acquisition for receiving the carrying project label that the intermediate server sends is asked, the project label correspondence is sent Item file give the intermediate server;
Receive the synchronous documents that the intermediate server sends.
8. the method according to claim 6 or 7, it is characterised in that
First manager is Git managers, and second manager is SVN managers;Or,
First manager is SVN managers, and second manager is Git managers.
9. a kind of code synchronisation system, it is characterised in that the system includes the first manager, intermediate server and the second management Device;
First manager, for sending synchronization notice to the intermediate server, obtains when the intermediate server is received When replacing the acquisition of code to ask, code to be synchronized is transmitted to the intermediate server, the synchronization notice carries the first manager Mark, the mark of the second manager, project label and submit to daily record;
The intermediate server, for receiving the synchronization notice, mark and the item target according to second manager Know, obtain the corresponding item file of the project label;According to the mark of first manager, obtained from first manager Take code to be synchronized;The code addition to be synchronized is obtained into synchronous documents in the item file, by the submission daily record Second manager is sent to the synchronous documents;
Second manager, for when the acquisition for receiving the carrying project label that the intermediate server sends is asked, The corresponding item file of the project label is sent to the intermediate server;Receive the described same of the intermediate server transmission Step file.
10. system according to claim 9, it is characterised in that
First manager is Git managers, and second manager is SVN managers;Or,
First manager is SVN managers, and second manager is Git managers.
CN201611160667.3A 2016-12-15 2016-12-15 Code synchronization method and system Active CN106775714B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611160667.3A CN106775714B (en) 2016-12-15 2016-12-15 Code synchronization method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611160667.3A CN106775714B (en) 2016-12-15 2016-12-15 Code synchronization method and system

Publications (2)

Publication Number Publication Date
CN106775714A true CN106775714A (en) 2017-05-31
CN106775714B CN106775714B (en) 2020-10-16

Family

ID=58887683

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611160667.3A Active CN106775714B (en) 2016-12-15 2016-12-15 Code synchronization method and system

Country Status (1)

Country Link
CN (1) CN106775714B (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108038028A (en) * 2017-12-13 2018-05-15 江苏神州信源***工程有限公司 File backup method, device and file recovery method, device
CN108196877A (en) * 2018-01-16 2018-06-22 北京三快在线科技有限公司 The method and apparatus and computing device of component release management
CN109725927A (en) * 2018-05-08 2019-05-07 中国平安人寿保险股份有限公司 Synchronous method and device, the storage medium and terminal of code management system
CN109787997A (en) * 2019-02-26 2019-05-21 上海易点时空网络有限公司 TCP method of servicing and server based on PHP
CN111124467A (en) * 2018-10-31 2020-05-08 上海哔哩哔哩科技有限公司 Method and system for displaying authority role, computer equipment and readable storage medium
CN111338687A (en) * 2020-02-26 2020-06-26 北京慧博科技有限公司 Method for migrating svn version libraries to git version libraries using python
CN111459538A (en) * 2020-04-07 2020-07-28 中国建设银行股份有限公司 Code synchronization method and device
CN114221971A (en) * 2021-12-15 2022-03-22 中国建设银行股份有限公司 Data synchronization method, device, server, storage medium and product

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130290205A1 (en) * 2012-04-30 2013-10-31 Gild, Inc. Recruiting service graphical user interface
CN103581247A (en) * 2012-07-30 2014-02-12 杭州洱海科技有限公司 Method for testing distributed type Web based on cloud computing environment

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130290205A1 (en) * 2012-04-30 2013-10-31 Gild, Inc. Recruiting service graphical user interface
CN103581247A (en) * 2012-07-30 2014-02-12 杭州洱海科技有限公司 Method for testing distributed type Web based on cloud computing environment

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
BLA: "There is any way to synchronize GIT and Subversion repositories?", 《HTTPS://STACKOVERFLOW.COM/QUESTIONS/907913/THERE-IS-ANY-WAY-TO-SYNCHRONIZE-GIT-AND-SUBVERSION-REPOSITORIES》 *
WEIXIN_34109408: "window下svn,git混合使用", 《HTTPS://BLOG.CSDN.NET/WEIXIN_34109408/ARTICLE/DETAILS/91638052》 *
小稀稀和她的小摩的: "git-svn-让git和svn协同工作", 《HTTPS://WWW.CNBLOGS.COM/DJOEL/P/5757674.HTML》 *

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108038028B (en) * 2017-12-13 2021-03-23 北信源***集成有限公司 File backup method and device and file restoration method and device
CN108038028A (en) * 2017-12-13 2018-05-15 江苏神州信源***工程有限公司 File backup method, device and file recovery method, device
CN108196877A (en) * 2018-01-16 2018-06-22 北京三快在线科技有限公司 The method and apparatus and computing device of component release management
CN108196877B (en) * 2018-01-16 2019-01-29 北京三快在线科技有限公司 The method and apparatus and calculating equipment of component release management
CN109725927A (en) * 2018-05-08 2019-05-07 中国平安人寿保险股份有限公司 Synchronous method and device, the storage medium and terminal of code management system
CN111124467B (en) * 2018-10-31 2023-09-01 上海哔哩哔哩科技有限公司 Authority role display method, system, computer equipment and readable storage medium
CN111124467A (en) * 2018-10-31 2020-05-08 上海哔哩哔哩科技有限公司 Method and system for displaying authority role, computer equipment and readable storage medium
CN109787997B (en) * 2019-02-26 2021-06-11 上海易点时空网络有限公司 PHP-based TCP (Transmission control protocol) service method and server
CN109787997A (en) * 2019-02-26 2019-05-21 上海易点时空网络有限公司 TCP method of servicing and server based on PHP
CN111338687A (en) * 2020-02-26 2020-06-26 北京慧博科技有限公司 Method for migrating svn version libraries to git version libraries using python
CN111459538A (en) * 2020-04-07 2020-07-28 中国建设银行股份有限公司 Code synchronization method and device
CN111459538B (en) * 2020-04-07 2024-02-13 中国建设银行股份有限公司 Code synchronization method and device
CN114221971A (en) * 2021-12-15 2022-03-22 中国建设银行股份有限公司 Data synchronization method, device, server, storage medium and product
CN114221971B (en) * 2021-12-15 2024-04-19 中国建设银行股份有限公司 Data synchronization method, device, server, storage medium and product

Also Published As

Publication number Publication date
CN106775714B (en) 2020-10-16

Similar Documents

Publication Publication Date Title
CN106775714A (en) A kind of code synchronisation method and system
CN103294172B (en) The method that multiple mouse inputs is provided in remote desktop session
CN104216793B (en) Application Backup, the method and apparatus recovered
CN104965757A (en) Virtual machine live migration method, virtual machine migration management apparatus, and virtual machine live migration system
KR20210067415A (en) Platform providing system based on cloud computing and platform provision method using the same
JP6045134B2 (en) Parallel workload simulation for application performance testing
CN105787077A (en) Data synchronizing method and device
CN103077070B (en) Cloud computing management system and management method for cloud computing systems
CN106339177A (en) Method and device for creating virtual machines
CN111488995B (en) Method, device and system for evaluating joint training model
CN103401909A (en) Data interaction method and system based on BS (browser/server), client end and server
CN107678752A (en) A kind of task processing method and device towards isomeric group
CN109981279A (en) A kind of block catenary system, communication means, device, equipment and medium
US11303729B2 (en) Virtual workspace experience visualization and optimization
CN106201657A (en) A kind of network interface card information processing method based on virtual machine and device
CN110019346A (en) A kind of data processing method and device based on double primary databases
CN109491646B (en) Message entry method and device, electronic equipment and readable medium
CN111309624B (en) Test method, test device, test equipment and storage medium
CN110083341A (en) A kind of front end development platform, front end development approach and page display method
CN113946328A (en) Service processing method and system, storage medium and electronic equipment
CN104951528B (en) A kind of method and terminal of Data Migration
CN110221910A (en) Method and apparatus for executing MPI operation
CN114221971B (en) Data synchronization method, device, server, storage medium and product
CN110363538A (en) Product traceability method, intelligent terminal and cloud device
CN115292166A (en) Multi-person collaborative test case management method, device, equipment and medium

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
GR01 Patent grant
GR01 Patent grant