CN114780135A - Project management method and device based on git, electronic equipment and storage medium - Google Patents
Project management method and device based on git, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN114780135A CN114780135A CN202210315406.3A CN202210315406A CN114780135A CN 114780135 A CN114780135 A CN 114780135A CN 202210315406 A CN202210315406 A CN 202210315406A CN 114780135 A CN114780135 A CN 114780135A
- Authority
- CN
- China
- Prior art keywords
- branch
- project
- development
- version number
- functional
- 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
Images
Classifications
-
- 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
-
- 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
- G06F11/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/65—Updates
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The application discloses a method and a device for project management based on git, electronic equipment and a storage medium, wherein the method comprises the following steps: receiving a creating command of a functional branch, wherein the functional branch is used for editing project content; acquiring a project file of a development branch, wherein the project file comprises a version number and project content; modifying the version number of the development branch according to the creation command of the functional branch; creating a functional branch according to the modified version number, and restoring the version number of the development branch; and updating the project content of the development branch by using the project content of the function branch adjustment. The method and the device can quickly and accurately complete the editing and updating of the codes, and can also carry out standard management on the version numbers, the flow is simple, and the efficiency is improved.
Description
Technical Field
The present application relates to the field of code management technologies, and in particular, to a method and an apparatus for project management based on git, an electronic device, and a storage medium.
Background
The code amount of modern enterprise-level application programs is rapidly increased, and the traditional mail management mode obviously cannot meet the requirements of the software industry. However, the advent of Git has effectively addressed the problem of code versions. Git as an open source distributed version control system can process project version management effectively and high speed, it does not need the support of server software, which makes the release and exchange of source code very convenient.
However, with the rise of large software engineering, collaborative development becomes the mainstream, and multi-version synchronous development makes code branch management difficult, and especially when the code is managed by using the current GitFlow, not only the code version number needs to be managed manually, which is easy to cause confusion of the version number, but also code branch merging needs to be performed manually, which is complex in flow and low in efficiency, and cannot complete the management of multiple codes (management of the version number and update of the code) quickly and accurately.
Disclosure of Invention
The present application aims to provide a method, an apparatus, an electronic device and a storage medium for project management based on git, which can not only quickly and accurately complete the editing and updating of codes, but also perform standard management on version numbers, and have simple process and improved efficiency.
In order to achieve the above object, the present application provides a git-based project management method, which includes:
receiving a creating command of a functional branch, wherein the functional branch is used for editing project content;
acquiring a project file of a development branch, wherein the project file comprises a version number and project content;
modifying the version number of the development branch according to the creation command of the functional branch;
creating the functional branch according to the modified version number, and restoring the version number of the development branch;
and updating the project content of the development branch by using the project content adjusted by the function branch.
Optionally, the version number includes a release version number and identification information, where the identification information is used to indicate that the project file is in a development state.
Optionally, the "creating the functional branch according to the modified version number" includes:
copying the modified project file of the development branch to create a functional branch.
Optionally, the "modifying the version number of the development branch" includes:
and adding the branch name of the functional branch to the version number.
Optionally, after "updating the project content of the development branch with the project content adjusted by the functional branch", the method further includes:
and issuing the updated project file of the development branch.
Optionally, the "publishing the updated project file of the development branch" includes:
packaging the updated project files of the development branches by using a detection tool to obtain corresponding data packets;
testing the data packet;
and if the data packet passes the test, removing the identification information, and releasing the data packet to be online.
Optionally, the method further comprises:
and after the updated project file of the development branch is released, increasing the version number of the project file of the development branch.
In order to achieve the above object, the present application also provides a git-based project management apparatus, comprising:
the receiving module is used for receiving a creating command of a functional branch, and the functional branch is used for editing project content;
the acquisition module is used for acquiring a project file of a development branch, wherein the project file comprises a version number and project content;
the modification module is used for modifying the version number of the development branch according to the creation command of the functional branch;
the creating module is used for creating the functional branch according to the modified version number and restoring the version number of the development branch;
and the updating module is used for updating the project content of the development branch by utilizing the project content adjusted by the functional branch.
In order to achieve the above object, the present application also provides an electronic device, comprising:
a processor;
a memory having stored therein executable instructions of the processor;
wherein the processor is configured to perform the git-based project management method as described above via execution of the executable instructions.
To achieve the above object, the present application also provides a computer-readable storage medium having stored thereon a computer program comprising instructions that, when executed by a processor, implement the git-based project management method as described above.
The present application also provides a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, causing the electronic device to perform the git-based project management method as described above.
When a creating command of a functional branch is received, an item file of the development branch is obtained, the item file comprises a version number and item content, the version number of the development branch is modified according to the creating command of the functional branch, the functional branch is created according to the modified version number, the version number of the development branch is recovered, and finally the item content of the development branch is updated by using the item content adjusted by the functional branch. The method and the device have the advantages that the functional branch is created by modifying the version number of the development branch and reserving the project content of the development branch, the created functional branch can be used for editing the project content, in addition, the disorder of a plurality of version numbers is avoided, the version number of the development branch is restored, so that the version number of the development branch is consistent with the version number before modification, the project content adjusted by the functional branch can be conveniently and accurately utilized for updating the project content of the development branch, the code can be rapidly and accurately edited and updated, the version number can be subjected to standard management, the flow is simple, and the efficiency is improved.
Drawings
Fig. 1 is a flowchart illustrating a method for project management based on git according to an embodiment of the present application.
FIG. 2 is a block diagram of a git-based project management apparatus according to an embodiment of the present application.
Fig. 3 is a schematic block diagram of an electronic device according to an embodiment of the application.
FIG. 4 is another flowchart of a git-based project management method according to an embodiment of the present application.
Detailed Description
In order to explain technical contents, structural features, implementation principles, and objects and effects of the present application in detail, the following description is made in conjunction with the accompanying drawings.
Referring to fig. 1, an embodiment of the present application discloses a method for project management based on git, which includes:
101. a command to create a functional branch for editing the content of the project is received.
Generally, Git, as an open source distributed version control system, can provide a convenient management way for technicians. Management of the project may be performed by creating a development branch, a release branch, and the like. And the creation of the function branch through Git can perform addition adjustment, bug repair and the like of the function of the project.
Specifically, when function addition, adjustment or bug repair is required to be performed on the item, a creation command of the function branch may be sent so that the system receives the creation command of the function branch.
The functional branches may be various editions of the item content, may be directly adding part of the item content, may be directly deleting part of the item content, and may be, of course, modifying the item content in the original item content, and the like, and are not limited herein as long as the item content is changed.
102. And acquiring a project file of the development branch, wherein the project file comprises a version number and project content.
Specifically, creating a functional branch to edit project content is based on an existing project. Therefore, after receiving the creation command of the functional branch, the project file of the development branch is acquired.
In particular, project files typically include source files, each having a corresponding version number, such as a 1.0.0-SNAPSHOT version, and project content, such as source code, etc.
In particular, a maven tool, such as a MavenProject tool, may be used to obtain project files for development branches. Specifically, all child items are recursively acquired using the getModules method provided by MavenProject, and the version numbers of the items are acquired using the getVersion method.
In some embodiments, the version number includes a release version number and identification information for indicating that the project file is in a development state.
By setting the release version number and the identification information in the version number, the corresponding release version number can be quickly obtained, so that the versions of the project files can be distinguished conveniently, and meanwhile, the identification information can clearly reflect that the current project is in a development state, so that the state of the project files can be conveniently obtained.
Specifically, the release version number may be in a numeric form, such as version 1.0.0, etc., an alphabetical form, such as version a, a combined alphabetical and numeric form, such as version A1.0.0, or other forms, such as a character string, etc., which is not limited herein. Meanwhile, the identification information may have various forms, which is not limited herein, for example, in maven, the identification information may use snap hot as the identification, and the version number of the project file may be marked as 1.0.0-snap to indicate that the release version number of the project file is 1.0.0 version, and the identification information snap hot reflects that the project file is in a development state, and may perform operations such as editing.
103. And modifying the version number of the development branch according to the creation command of the functional branch.
In particular, a getpoimfile method is used to obtain a pom.
In some embodiments, the "version number of the modified development branch" includes:
adding the branch name of the functional branch to the version number.
The branch names of the functional branches are added to the version number, so that the functional branches can be distinguished conveniently, and the branch names of the corresponding functional branches can be known clearly and quickly.
Specifically, in the creation command of the functional branch, the branch name of the functional branch, such as V1, V2, etc., may be defined by itself. When a creating command of the functional branch is received, the branch name of the corresponding functional branch can be obtained.
Referring to fig. 4, for example, assuming that the version number of the project file a of the development branch is 1.0.0-snap, when a creation command of the functional branch is received (where the branch name of the functional branch is set to B1), the version number of the development branch is modified, and the branch name B1 of the functional branch is added to the version number, that is, the version number is changed from 1.0.0-snap to 1.0.0-B1-snap or other combinations. It should be noted that the specific development branches, version numbers of the functional branches, and the like are merely illustrated for convenience of understanding and explanation, and are not limited herein.
104. Creating a functional branch according to the modified version number, and restoring the version number of the development branch.
Specifically, the creation of the functional branch is performed based on the project file of the development branch, the version number of the development branch is modified, and the functional branch is created while the project content of the development branch is kept unchanged, so that the functional branch corresponding to the project content of the development branch is provided, the reliability of the functional branch (edited on the project content of the development branch) is ensured, and in addition, the version number of the development branch is restored after the version number of the development branch is modified, so that the management of the development branch is facilitated. Optionally, the version number of the recovery development branch is created from the functional branch that precedes the version number of the development branch on the time node, so that a conflict between the version number of the project file of the development branch and the version number of the project file of the development branch is avoided under the condition of multiple functional branches, and it can be ensured that the project file of the development branch can be updated by using the functional branches smoothly in the following process.
In some embodiments, the "creating a functional branch according to a modified version number" includes:
the project file of the modified development branch is copied to create a functional branch.
By copying the project file of the modified development branch to create the function branch, the project content edited is ensured to be edited on the basis of the project content of the project file of the development branch when the project content needs to be edited, and the reliability of the function branch is favorably improved.
Referring to fig. 4, the above specific values are continuously referred to for illustration, the project file of the modified development branch is copied to create a functional branch, at this time, the version number of the functional branch is 1.0.0-B1-snap, (which is identical to the version number of the project file of the modified development branch and has the same project content), then the project content of the functional branch can be edited according to the requirement (which can be directly adding part of the project content, or directly deleting part of the project content, or of course, modifying the project content in the original project content, etc.), in addition, the version number of the development branch is restored, and the version number of the project file of the modified development branch is restored from 1.0.0-B1-snap to 1.0.0-snap. It should be noted that the above specific development branches, version numbers of the functional branches, and item contents are merely for convenience of understanding and explanation, and are not limited herein.
105. And updating the project content of the development branch by using the project content adjusted by the function branch.
Specifically, after the item content of the functional branch is adjusted, the item content of the development branch is updated according to the adjusted item content, which may be directly copying the item content adjusted by the functional branch, directly deleting the item content adjusted by the functional branch, correspondingly replacing the item content of the development branch with the item content adjusted by the functional branch, or, of course, updating the entire item content adjusted by the functional branch to the item content of the development branch in an overlaying manner to update the item content of the development branch, so as to update the item file of the development branch.
Specifically, the process of updating the item content adjusted by the function branch to the development branch may be provided by the code management software Git, which compares the hash value of the file to determine whether the file has been changed, and if so, updates are performed, but may also take other forms, which is not limited herein.
Referring to fig. 4, continuing to refer to the specific values mentioned above, for example, the version number after the functional branch is created is 1.0.0-B1-snap, and the version number after the development branch is restored is 1.0.0-snap. And editing the project content of the functional branch according to the requirement to obtain the edited project content, and updating the project content of the development branch according to the edited project content, wherein the version number corresponding to the development branch is still 1.0.0-SNAPSHOT. It should be noted that the above specific development branches, version numbers of the functional branches, and item contents are merely for convenience of understanding and explanation, and are not limited herein.
In some embodiments, after "updating the project content of the development branch with the project content of the function branch adjustment", the method further includes:
and releasing the updated project file of the development branch.
By releasing the updated project files of the development branches, the project files of newer versions can be uploaded conveniently in time, and the use is convenient.
Specifically, when the update is released, the project file of the development branch is copied to the release branch for release.
Further, the "distributing the project file of the updated development branch" includes:
packaging the updated project files of the development branches by using a detection tool to obtain corresponding data packets;
testing the data packet;
and if the data packet passes the test, removing the identification information and releasing the data packet to be online.
The updated project files of the development branches are packaged and detected through the detection tool, so that whether the data packet has the condition of online release or not is determined, and the safety and the stability of the released data packet are ensured.
In particular, the testing of the data packet is a routine technical means for those skilled in the art, and is not described herein, as long as the security and stability of the data packet can be tested. And when the safety and the stability of the data packet are good, removing the identification information of the data packet and releasing the data packet to be online.
Further, the method further comprises:
and after the updated project file of the development branch is released, the version number of the project file of the development branch is increased.
The version number of the project file of the development branch is increased after the updated project file of the development branch is released, so that the project file is convenient to manage.
Referring to fig. 4, the above specific values are continuously referred to for illustration, assuming that the item file of the development branch has been updated and has a version number of 1.0.0-snap, the item file of the development branch after updating is packaged and tested by using the detection tool, when the test passes, the identification information is removed, the version number becomes 1.0.0, the data package is released to the upper line, and the version number of the item file of the development branch is increased, and the version number of the item file of the development branch is upgraded from 1.0.0-snap to 1.1.0-snap.
The method comprises the steps of obtaining a project file of a development branch when a creation command of a functional branch is received, wherein the project file comprises a version number and project content, modifying the version number of the development branch according to the creation command of the functional branch, creating the functional branch according to the modified version number, restoring the version number of the development branch, and finally updating the project content of the development branch by using the project content adjusted by the functional branch. The method and the device have the advantages that the functional branch is created by modifying the version number of the development branch and reserving the project content of the development branch, the created functional branch can be used for editing the project content, in addition, the disorder of a plurality of version numbers is avoided, the version number of the development branch is restored, so that the version number of the development branch is consistent with the version number before modification, the project content adjusted by the functional branch can be conveniently and accurately utilized for updating the project content of the development branch, the code can be rapidly and accurately edited and updated, the version number can be subjected to standard management, the flow is simple, and the efficiency is improved.
Referring to fig. 2, an embodiment of the present application further discloses a git-based project management apparatus, which includes:
the receiving module 10, the receiving module 10 is configured to receive a creating command of a functional branch, where the functional branch is used to edit project content;
the acquisition module 11 is configured to acquire a project file of a development branch, where the project file includes a version number and project content;
the modification module 12, the modification module 12 is used for modifying the creation command according to the functional branch and modifying the version number of the development branch;
the creating module 13 is used for creating a functional branch according to the modified version number and restoring the version number of the development branch;
and the updating module 14, wherein the updating module 14 is used for updating the project content of the development branch by using the project content adjusted by the function branch.
For a detailed description of the git-based project management apparatus, see the git-based project management method for details, which are not described herein again.
Referring to fig. 3, an embodiment of the present application further discloses an electronic device, which includes:
a processor 21;
a memory 20 having stored therein executable instructions of the processor 21;
wherein the processor 21 is configured to perform the above-described git-based project management method via execution of executable instructions.
The embodiment of the present application further discloses a computer-readable storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements the above-mentioned git-based project management method.
Embodiments of the present application also disclose a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the electronic device performs the above-mentioned git-based project management method.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware associated with computer program instructions, and the programs can be stored in a computer readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
The above disclosure is only a preferred embodiment of the present application and should not be taken as limiting the scope of the present application, so that the claims of the present application are covered by the appended claims.
Claims (10)
1. A git-based project management method, comprising:
receiving a creating command of a functional branch, wherein the functional branch is used for editing project content;
acquiring a project file of a development branch, wherein the project file comprises a version number and project content;
modifying the version number of the development branch according to the creation command of the functional branch;
creating the functional branch according to the modified version number, and restoring the version number of the development branch;
and updating the project content of the development branch by using the project content adjusted by the function branch.
2. A git-based project management method according to claim 1, characterized in that,
the version number comprises a release version number and identification information, and the identification information is used for indicating that the project file is in a development state.
3. A git-based project management method according to claim 2, characterized in that,
the step of creating the functional branch according to the modified version number comprises the following steps:
copying the modified project file of the development branch to create a functional branch.
4. A git-based project management method as claimed in claim 1,
the "modifying the version number of the development branch" includes:
adding the branch name of the functional branch to the version number.
5. A git-based project management method according to claim 2, characterized in that,
after "updating the project content of the development branch with the project content adjusted by the functional branch", the method further includes:
and issuing the updated project file of the development branch.
6. A git-based project management method according to claim 5, characterized in that,
the "distributing the updated project file of the development branch" includes:
packaging the updated project files of the development branches by using a detection tool to obtain corresponding data packets;
testing the data packet;
and if the data packet passes the test, removing the identification information, and releasing the data packet to be online.
7. The git-based project management method of claim 5, further comprising:
and after the updated project file of the development branch is released, increasing the version number of the project file of the development branch.
8. A git-based project management apparatus, comprising:
a receiving module, configured to receive a command to create a functional branch, where the functional branch is used to edit project content;
the system comprises an acquisition module, a storage module and a processing module, wherein the acquisition module is used for acquiring project files of development branches, and the project files comprise version numbers and project contents;
the modification module is used for modifying the version number of the development branch according to the creation command of the functional branch;
the creating module is used for creating the functional branch according to the modified version number and restoring the version number of the development branch;
and the updating module is used for updating the project content of the development branch by using the project content adjusted by the functional branch.
9. An electronic device, comprising:
a processor;
a memory having stored therein executable instructions of the processor;
wherein the processor is configured to perform the git-based project management method of any of claims 1-7 via execution of the executable instructions.
10. A computer-readable storage medium, having stored thereon a computer program, wherein the computer program, when executed by a processor, implements the git-based project management method of any of claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210315406.3A CN114780135A (en) | 2022-03-28 | 2022-03-28 | Project management method and device based on git, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210315406.3A CN114780135A (en) | 2022-03-28 | 2022-03-28 | Project management method and device based on git, electronic equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114780135A true CN114780135A (en) | 2022-07-22 |
Family
ID=82425812
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210315406.3A Pending CN114780135A (en) | 2022-03-28 | 2022-03-28 | Project management method and device based on git, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114780135A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115543394A (en) * | 2022-12-01 | 2022-12-30 | 云账户技术(天津)有限公司 | APP dynamic update management method and system, electronic device and readable storage medium |
CN115599437A (en) * | 2022-10-26 | 2023-01-13 | 北京领雁科技股份有限公司(Cn) | Software version processing method and device, electronic equipment and storage medium |
-
2022
- 2022-03-28 CN CN202210315406.3A patent/CN114780135A/en active Pending
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115599437A (en) * | 2022-10-26 | 2023-01-13 | 北京领雁科技股份有限公司(Cn) | Software version processing method and device, electronic equipment and storage medium |
CN115599437B (en) * | 2022-10-26 | 2023-10-20 | 北京领雁科技股份有限公司 | Software version processing method and device, electronic equipment and storage medium |
CN115543394A (en) * | 2022-12-01 | 2022-12-30 | 云账户技术(天津)有限公司 | APP dynamic update management method and system, electronic device and readable storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109271326B (en) | Cloud database testing method and device, equipment and storage medium thereof | |
CN114780135A (en) | Project management method and device based on git, electronic equipment and storage medium | |
CN110442371B (en) | Method, device and medium for releasing codes and computer equipment | |
JP3386232B2 (en) | Test computer system | |
US9348568B2 (en) | Software application porting system | |
CN105867903A (en) | Method and device or splitting code library | |
CN111159099A (en) | Online data generation method and device, electronic equipment and storage medium | |
CN111367890A (en) | Data migration method and device, computer equipment and readable storage medium | |
CN110990051B (en) | Maintenance method, device, medium and equipment for software package dependency relationship | |
CN113792026B (en) | Method and device for deploying database script and computer-readable storage medium | |
CN111290961A (en) | Interface test management method and device and terminal equipment | |
CN111984666A (en) | Database access method and device, computer readable storage medium and computer equipment | |
CN112035308A (en) | Method and device for generating system interface test table | |
JP4215255B2 (en) | Degradation confirmation inspection method, degradation confirmation inspection system, and program therefor | |
CN112035124A (en) | Application deployment method and device | |
CN115857959A (en) | Service module deployment method, device, equipment and storage medium of platform | |
CN111309370B (en) | Version number directed graph ordering auditing method and system for multi-project multi-system environment | |
CN113050986A (en) | Object management method and device | |
CN112473145A (en) | Data processing method and device based on game engine | |
CN112052184A (en) | Automatic generation method and device for test script and storage medium | |
CN115047835B (en) | DCS-based periodic test data acquisition method, device, equipment and medium | |
Olsson et al. | Git Version Control Cookbook | |
CN117978818B (en) | Cross-environment page synchronization method, device, equipment and storage medium | |
CN112306416B (en) | Method and terminal for automatically reading and writing NV (network video) parameters | |
CN113448777B (en) | Data recovery method and device |
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 |