A software warehouse management method, device, equipment and storage medium
By implementing local cloning, modifying and pushing functions of multiple Git repositories in code management tools, the problem that existing tools cannot efficiently manage multiple Git repositories is solved, and the management efficiency of software projects is improved.
Patent Information
- Application Number
- CN202411665535.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-20
- Publication Date
- 2025-04-04
AI Technical Summary
Existing code management tools cannot efficiently manage the code of multiple Git repositories, especially when system reconstruction, the code of multiple Git repositories needs to be loaded at the same time for analysis and reconstruction, resulting in inefficient management.
A software warehouse management method is proposed, including cloning multiple remote code repositories to the local code repository, modifying the local code in response to user modification instructions, obtaining the modified code information, and pushing it to the target remote code repository to update the code of the software project.
Through this method, the code of multiple code warehouses can be managed simultaneously, the management efficiency of software projects can be improved, batch submission of codes can be supported, and suitable for system reconstruction and other needs.
Smart Images

Figure CN119759403A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of code management, and in particular to a software warehouse management method, a software warehouse management apparatus, a software warehouse management device, and a computer storage medium. Background Art
[0002] Code management tools on the market can usually only manage one repository at a time, but company-level projects often split the code by business, resulting in the code being in multiple Git repositories. When refactoring the system, it is often necessary to load the code from multiple Git repositories for analysis and refactoring, which then involves the need to submit code in batches. Current code management tools cannot provide efficient management functions. Summary of the invention
[0003] In order to solve the above technical problems, the present application proposes a software warehouse management method, a software warehouse management apparatus, a software warehouse management device and a computer storage medium.
[0004] In order to solve the above technical problems, the present application proposes a software warehouse management method, which includes:
[0005] Clone the remote code of several remote code repositories to the local code repository, where each remote code repository contains part of the code of the software project;
[0006] In response to a modification instruction from a user, modify the local code in the local code repository and obtain modified code information;
[0007] Obtaining a target remote code repository corresponding to the modified code information;
[0008] The modified code information is pushed to the target remote code repository, so that the target remote code repository updates the code of the software project according to the modified code information.
[0009] The warehouse address of the remote code warehouse is stored and displayed according to the component relationship tree structure of the software project.
[0010] Wherein, after modifying the local code in the local code repository in response to the modification instruction of the user, the software repository management method further includes:
[0011] Monitoring code files in the local code repository;
[0012] The modified code files are displayed according to the component relationship tree structure of the software project.
[0013] After the code files to be modified are displayed according to the component relationship tree structure of the software project, the software warehouse management method further includes:
[0014] In response to a selection instruction of a user on the component relationship tree structure of the software project, code changes of the code file corresponding to the selection instruction are acquired and displayed.
[0015] Wherein, obtaining modification code information includes:
[0016] Submitting the relevant code modified according to the modification instruction to the temporary storage area of the local code repository;
[0017] After the modification task of the modification instruction is completed, the code in the temporary storage area is submitted to the resource library of the local code warehouse.
[0018] Wherein, after the modification task of the modification instruction is completed, submitting the code of the temporary storage area to the resource library of the local code warehouse includes:
[0019] After the modification task of the modification instruction is completed, submitting the project code of the working area of the local code repository to the temporary storage area;
[0020] Submit the code in the temporary storage area to the resource library of the local code warehouse.
[0021] Wherein, the software warehouse management method further includes:
[0022] Initialize version control tools;
[0023] The version control tool provides a clone function and / or a push function.
[0024] In order to solve the above technical problems, the present application also proposes a software warehouse management device, which includes a cloning module, a modification module, an acquisition module, and an update module; wherein:
[0025] The cloning module is used to clone remote codes of several remote code repositories to the local code repository, wherein each remote code repository contains part of the code of the software project;
[0026] The modification module is used to modify the local code in the local code repository in response to a modification instruction of the user, and obtain modified code information;
[0027] The acquisition module is used to acquire the target remote code repository corresponding to the modified code information;
[0028] The update module is used to push the modified code information to the target remote code repository, so that the target remote code repository updates the code of the software project according to the modified code information.
[0029] To solve the above technical problems, the present application also proposes a software warehouse management device, which includes a memory and a processor coupled to the memory; wherein the memory is used to store program data, and the processor is used to execute the program data to implement the software warehouse management method as described above.
[0030] In order to solve the above technical problems, the present application also proposes a computer storage medium, which is used to store program data. When the program data is executed by a computer, it is used to implement the above software warehouse management method.
[0031] Compared with the prior art, the beneficial effects of the present application are: the software warehouse management device clones the remote codes of several remote code warehouses to the local code warehouse, wherein each remote code warehouse contains part of the code of the software project; in response to the user's modification instruction, the local code in the local code warehouse is modified to obtain the modified code information; the target remote code warehouse corresponding to the modified code information is obtained; the modified code information is pushed to the target remote code warehouse, so that the target remote code warehouse updates the code of the software project according to the modified code information. Through the above-mentioned software warehouse management method, the codes of multiple code warehouses can be managed at the same time, which can effectively improve the management of software projects. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0033] in:
[0034] Figure 1 It is a flowchart of an embodiment of a software warehouse management method provided by the present application;
[0035] Figure 2 It is a flowchart of another embodiment of the software warehouse management method provided by the present application;
[0036] Figure 3 It is a flowchart of another embodiment of the software warehouse management method provided by the present application;
[0037] Figure 4It is a structural diagram of an embodiment of a software warehouse management device provided by the present application;
[0038] Figure 5 It is a structural diagram of an embodiment of a software warehouse management device provided by the present application;
[0039] Figure 6 It is a structural diagram of an embodiment of a computer storage medium provided by the present application. DETAILED DESCRIPTION
[0040] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0041] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can, for example, be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0042] The Git repository involved in this application is the most advanced distributed version control system in the world. Git has four working areas:
[0043] Working Directory: The place where project code is usually stored.
[0044] Staging area (Stage / index): Saves the list of files to be submitted.
[0045] Repository, also called local repository (Repository or Git Directory): a safe place to store data, where you can find all the versions of data you submitted.
[0046] Remote Directory: A server that hosts code, such as GitHub or Gitee.
[0047] Git's workflow includes but is not limited to: working directory > git add > staging area > git commit > local repository; local repository > git push > remote repository; remote repository > git pull > local repository.
[0048] Based on the above technical principles, this application proposes a software solution for managing multiple GIT repositories at the same time. Figure 1 , Figure 1 It is a flowchart of an embodiment of a software warehouse management method provided by the present application.
[0049] The software warehouse management method of the present application is applied to a software warehouse management device, wherein the software warehouse management device of the present application can be a server, a terminal device, or a system in which a server and a terminal device cooperate with each other. Accordingly, the various parts included in the software warehouse management device, such as various units, sub-units, modules, and sub-modules, can all be set in the server, can all be set in the terminal device, or can be set in the server and the terminal device respectively.
[0050] Furthermore, the above-mentioned server can be hardware or software. When the server is hardware, it can be implemented as a distributed server cluster consisting of multiple servers, or it can be implemented as a single server. When the server is software, it can be implemented as multiple software or software modules, such as software or software modules used to provide distributed servers, or it can be implemented as a single software or software module, which is not specifically limited here.
[0051] like Figure 1 As shown, the specific steps are as follows:
[0052] Step S11: Clone the remote codes of several remote code repositories to the local code repository, wherein each remote code repository contains part of the code of the software project.
[0053] In an embodiment of the present application, the software warehouse management device clones the remote code of several remote code warehouses to the local code warehouse, wherein each remote code warehouse contains part of the code of the software project. This is because the management of the software code, such as modification, needs to be performed in the local code warehouse, and the remote code warehouse stores the software code of the current version of the software project. The software warehouse management device needs to clone the software code of the current version of the software project from the remote code warehouse to the local code warehouse in order to achieve real-time management of the current software project.
[0054] Specifically, the operation instructions and control instructions involved in the software warehouse management method of the present application can be implemented through scripts, plug-in functions provided by third-party APIs, etc.
[0055] In a specific embodiment, the software warehouse management device can also achieve control by initializing a version control tool, namely simpleGit, wherein simpleGit is a Git library based on Node.js, which provides developers with a simple and intuitive way to interact with Git. In modern software development, version control tools such as Git have become indispensable. For Node.js developers, interacting with Git is usually done through the command line. However, sometimes in a project, we may need to perform Git operations through code. At this time, the simpleGit library is very useful.
[0056] Specifically, the software repository management device can clone the codes of the remote code repository to the local repository by batch calling the clone method provided by simpleGit for each code repository.
[0057] It should be noted that in the subsequent implementation examples, the software warehouse management device can all be controlled using simpleGit, which is not listed here one by one.
[0058] Furthermore, in order to provide the best visualization effect, the software warehouse management device can add the corresponding addresses of multiple remote code warehouses in the software related interface, including but not limited to facilitating the understanding of project relationships through a tree structure. Each component code set of the software project is used as a tree node, and the parent-child relationship and connection relationship between the tree nodes represent the code relationship of each component code set in the software project.
[0059] The user can choose to clone the codes of all remote code repositories through the software repository management device, or can select the corresponding addresses of one or more remote code repositories through the tree structure to clone part of the remote code repositories.
[0060] Step S12: In response to the user's modification instruction, the local code in the local code repository is modified to obtain modified code information.
[0061] In the embodiment of the present application, the user inputs a modification instruction through the software warehouse management device, and the software warehouse management device modifies the local code in the local code warehouse according to the modification instruction and generates modification code information. The modification method indicated in the modification instruction includes but is not limited to: adding, deleting, overwriting, etc.
[0062] Furthermore, the software repository management device can display the code changes in the local code repository to the user in a visual manner. Figure 2 , Figure 2 It is a flowchart of another embodiment of the software warehouse management method provided by the present application.
[0063] like Figure 2 As shown, the specific steps are as follows:
[0064] Step S21: monitor the code files in the local code repository.
[0065] In the embodiment of the present application, the software warehouse management device monitors whether all files in the local code warehouse are modified through the fs.watchFile method provided in Node.js. If the code file is modified, the process proceeds to step S22.
[0066] Step S22: Display the modified code files according to the component relationship tree structure of the software project.
[0067] In the embodiment of the present application, if the software warehouse management device finds that a file has been modified, it obtains the status of the project through the status method provided by simpleGit, and displays the changed files in the form of tree data on the user interface.
[0068] Step S23: in response to a selection instruction of the user on the component relationship tree structure of the software project, code changes of the code file corresponding to the selection instruction are acquired and displayed.
[0069] In an embodiment of the present application, if the user clicks on a file corresponding to the tree data displayed in step S22, the software warehouse management device calls the diff method of simpleGit to display detailed changes in the file to the user so that the user can check whether the changes in the code file are legal.
[0070] Please refer to Figure 3 , Figure 3 It is a flowchart of another embodiment of the software warehouse management method provided by the present application.
[0071] like Figure 3 As shown, the specific steps are as follows:
[0072] Step S31: Submitting the relevant code modified according to the modification instruction to the temporary storage area of the local code repository.
[0073] In an embodiment of the present application, the software warehouse management device submits the relevant code modified according to the user's modification instruction to the temporary storage area of the local code warehouse.
[0074] Specifically, since the user may modify the codes of multiple local code repositories at the same time, the software repository management device can also call the add method of simpleGit in batches for each code repository to submit the relevant code modifications to the temporary storage area.
[0075] The relevant codes may be all codes in the modified code file, or may be only the codes before and after the modified code.
[0076] Step S32: After the modification task of the modification instruction is completed, the code in the temporary storage area is submitted to the resource library of the local code warehouse.
[0077] In the embodiment of the present application, when the code modification is completed, the user can click the commit button on the interface to trigger the code submission action. Before submitting the code, the user of the software warehouse management device needs to choose whether to submit the code in the "temporary area" or the code in the "working area + temporary storage area".
[0078] If only the code in the "temporary storage area" is to be submitted, the software warehouse management device will batch call the simpleGit commit method for each code warehouse to batch submit the code. If the user chooses to submit the code in the "working area + temporary storage area", the simpleGit add method will be first batch called for each code warehouse to add the code still in the working area to the temporary storage area, and then the simpleGit commit method will be batch called for each code warehouse to batch submit the code.
[0079] Step S13: Obtain the target remote code repository corresponding to the modified code information.
[0080] In an embodiment of the present application, the software repository management device determines a target remote code repository where a code modification scenario occurs, wherein the target remote code repository may be only a remote code repository where a code modification scenario occurs, or may be all remote code repositories.
[0081] Specifically, the software warehouse management device can directly locate the corresponding remote code warehouse by modifying the local code warehouse where the code specified by the instruction is located, or by Figure 2 The software repository management method shown in the figure mentions monitoring the changed local code repository and locating the corresponding remote code repository through the fs.watchFile method provided in Node.js.
[0082] Step S14: Push the modified code information to the target remote code repository, so that the target remote code repository updates the code of the software project according to the modified code information.
[0083] In an embodiment of the present application, when the user confirms that there is no problem with the code, the software repository management device calls the push method of simpleGit in batches for the modified remote code repository to push the modifications to the remote code repository.
[0084] In the embodiment of the present application, the software warehouse management device Figures 1 to 3The software repository management method shown can realize the submission of codes of hundreds of projects at one time, which is convenient for system reconstruction.
[0085] In the present application, a software warehouse management device clones the remote codes of several remote code warehouses to a local code warehouse, wherein each remote code warehouse contains part of the code of a software project; in response to a user's modification instruction, the local code in the local code warehouse is modified to obtain modification code information; the target remote code warehouse corresponding to the modification code information is obtained; the modification code information is pushed to the target remote code warehouse, so that the target remote code warehouse updates the code of the software project according to the modification code information. Through the above-mentioned software warehouse management method, the codes of multiple code warehouses can be managed at the same time, which can effectively improve the management of software projects.
[0086] Those skilled in the art will appreciate that, in the above method of specific implementation, the order in which the steps are written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of the steps should be determined by their functions and possible internal logic.
[0087] In order to implement the above software warehouse management method, this application also proposes a software warehouse management device, please refer to Figure 4 , Figure 4 It is a structural diagram of an embodiment of a software warehouse management device provided by the present application.
[0088] The software warehouse management device 500 of this embodiment includes a cloning module 51 , a modification module 52 , an acquisition module 53 , and an update module 54 .
[0089] The cloning module 51 is used to clone the remote codes of several remote code repositories to the local code repository, wherein each remote code repository contains part of the code of the software project.
[0090] The modification module 52 is used to modify the local code in the local code repository in response to a modification instruction from a user, and obtain modified code information.
[0091] The acquisition module 53 is used to acquire the target remote code repository corresponding to the modified code information.
[0092] The updating module 54 is used to push the modified code information to the target remote code repository, so that the target remote code repository updates the code of the software project according to the modified code information.
[0093] In order to implement the above software warehouse management method, this application also proposes a software warehouse management device, please refer to Figure 5 , Figure 5It is a structural diagram of an embodiment of a software warehouse management device provided by the present application.
[0094] The software warehouse management device 400 of this embodiment includes a processor 41 , a memory 42 , an input / output device 43 , and a bus 44 .
[0095] The processor 41 , the memory 42 , and the input / output device 43 are respectively connected to the bus 44 . The memory 42 stores program data. The processor 41 is used to execute the program data to implement the software warehouse management method described in the above embodiment.
[0096] In the embodiment of the present application, the processor 41 may also be referred to as a CPU (Central Processing Unit). The processor 41 may be an integrated circuit chip having the ability to process signals. The processor 41 may also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gates or transistor logic devices, or discrete hardware components. A general-purpose processor may be a microprocessor or the processor 41 may also be any conventional processor, etc.
[0097] This application also provides a computer storage medium, please continue to refer to Figure 6 , Figure 6 It is a structural diagram of an embodiment of a computer storage medium provided in the present application. The computer storage medium 600 stores a computer program 61. When the computer program 61 is executed by a processor, it is used to implement the software warehouse management method of the above embodiment.
[0098] When the embodiments of the present application are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk.
[0099] The above description is only an implementation method of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly used in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A software warehouse management method, characterized in that: The software warehouse management method comprises: Clone the remote code of several remote code repositories to the local code repository, where each remote code repository contains part of the code of the software project; In response to a modification instruction from a user, modify the local code in the local code repository and obtain modified code information; Obtaining a target remote code repository corresponding to the modified code information; The modified code information is pushed to the target remote code repository, so that the target remote code repository updates the code of the software project according to the modified code information.
2. The software warehouse management method according to claim 1, characterized in that: The warehouse address of the remote code warehouse is stored and displayed according to the component relationship tree structure of the software project.
3. The software warehouse management method according to claim 1, characterized in that: After the local code in the local code repository is modified in response to the modification instruction of the user, the software repository management method further includes: Monitoring code files in the local code repository; The modified code files are displayed according to the component relationship tree structure of the software project.
4. The software warehouse management method according to claim 3, characterized in that: After the code files to be modified are displayed according to the component relationship tree structure of the software project, the software warehouse management method further includes: In response to a selection instruction of a user on the component relationship tree structure of the software project, code changes of the code file corresponding to the selection instruction are acquired and displayed.
5. The software warehouse management method according to claim 1, characterized in that: The obtaining of modification code information includes: Submitting the relevant code modified according to the modification instruction to the temporary storage area of the local code repository; After the modification task of the modification instruction is completed, the code in the temporary storage area is submitted to the resource library of the local code warehouse.
6. The software warehouse management method according to claim 5, characterized in that: After the modification task of the modification instruction is completed, submitting the code in the temporary storage area to the resource library of the local code warehouse includes: After the modification task of the modification instruction is completed, submitting the project code of the working area of the local code repository to the temporary storage area; Submit the code in the temporary storage area to the resource library of the local code warehouse.
7. The software warehouse management method according to claim 1, characterized in that: The software warehouse management method further includes: Initialize version control tools; The version control tool provides a clone function and / or a push function.
8. A software warehouse management device, characterized in that: The software warehouse management device includes a cloning module, a modification module, an acquisition module, and an update module; wherein, The cloning module is used to clone remote codes of several remote code repositories to the local code repository, wherein each remote code repository contains part of the code of the software project; The modification module is used to modify the local code in the local code repository in response to a modification instruction of the user, and obtain modified code information; The acquisition module is used to acquire the target remote code repository corresponding to the modified code information; The update module is used to push the modified code information to the target remote code repository, so that the target remote code repository updates the code of the software project according to the modified code information.
9. A software warehouse management device, characterized in that: The software warehouse management device includes a memory and a processor coupled to the memory; The memory is used to store program data, and the processor is used to execute the program data to implement the software warehouse management method according to any one of claims 1 to 7.
10. A computer storage medium, characterized in that: The computer storage medium is used to store program data, and when the program data is executed by a computer, it is used to implement the software warehouse management method according to any one of claims 1 to 7.