In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
Git Engineering Development practice (5)-- Git distributed Workflow I. brief introduction of Git distributed Workflow
Unlike centralized version control systems (CVCS), the distributed nature of Git makes collaboration among developers more flexible and diverse. In a centralized system, each developer is like a node connected to a hub, working in much the same way as each other. In Git, each developer acts as both a node and a hub, that is, each developer can not only contribute his own code to other repositories, but also maintain his own open repository, so that others can work on it and contribute code. As a result, Git's distributed collaboration can generate a variety of different workflows for projects and teams. The common Git distributed workflows are centralized workflow, integrated manager workflow, commander and adjutant workflow.
II. Git centralized workflow
The centralized workflow draws lessons from the working mode of the centralized version control system. Centralized workflow often contains a central server that can accept code; each developer, as a node, synchronizes his or her work with the central server. If two developers clone the code from the central repository and make some changes, only the first developer can successfully push the data back to the central server. The second developer must merge the work of the first person before pushing the changes so that they will not overwrite the changes of the first person.
A centralized workflow only needs to build a central warehouse and give everyone on the development team permission to push data to work. Git does not let users overwrite each other's changes. For example, John and Jessica start working at the same time. John made its own changes and pushed them to the server. Then Jessica tried to commit its own changes, but the server rejected it. Jessica will be told that her changes are being pushed in a non-fast-forward (non-fast-forward) way, which can only be pushed after the data has been grabbed and merged.
Centralized workflow is widely used, and most people are familiar with it and are used to it. But the centralized workflow is not limited to small teams. By using the Git branch model management, even hundreds of development teams can collaborate well on a single project by working on multiple branches at the same time.
Third, integrate the workflow of managers.
Git allows multiple remote repositories to exist, and each developer has write access to his own repository and read access to everyone else's repository. In the workflow of the integration manager, there is usually an authoritative repository of official projects. If you want to contribute to the project, you need to create your own public repository from the official project Fork, and then push your changes to your own public repository; then you can request the maintainer of the official warehouse to pull the update of your own open warehouse and merge it into the main project. The maintainer can add the contributor's open warehouse as a remote warehouse, test the contributor's changes locally, merge them into the maintainer's local warehouse branch and push them to the official warehouse.
The integration manager workflow works as follows:
A, the contributor cloned the official main warehouse to his own local area.
B. the contributor makes changes in his own local warehouse and pushes them to his own open warehouse.
C. Contributors send emails to maintainers requesting to pull their own updates.
D, the maintainer adds the contributor's open warehouse into a remote warehouse and merges modifications in his own local warehouse.
The maintainer pushes the merged changes to the official main warehouse.
Integration manager workflow is the most commonly used workflow for online code hosting tools such as GitHub and GitLab, which is very suitable for the development of community open source projects. Pull Request and Merge Request are the best engineering practices for integrating manager workflows.
Contributors can easily derive a project into their own public repository, push their changes to their own public repository, and be seen by everyone. The contributor can work continuously, and the maintainer of the main warehouse can pull the contributor's changes at any time. Contributors do not have to wait for maintainers to finish processing submitted updates, and each party can work at its own pace.
IV. The work flow of commanders and adjutants
Commander and adjutant workflows are variants of multi-warehouse workflows that are usually used by very large projects with hundreds of collaborating developers, such as the famous Linux kernel project. Each integration manager, known as an lieutenant, is responsible for specific parts of the integration project. All adjutants are also co-ordinated by a general integration manager whose superiors are called dictator. The warehouse maintained by the commander serves as a reference warehouse to provide all collaborators with the project code that needs to be pulled.
The work flow of the commander and adjutant is as follows:
A. ordinary developers work on their own feature branches and change bases according to the commander's master branch.
B, the adjutant merges the feature branch of the ordinary developer into his own master branch.
C. the commander merges the master branch of all the adjutants into his own master branch.
D, the commander pushes the integrated master branch to the reference repository so that all other developers can change the base on this basis.
The workflow of the commander and adjutant is not commonly used, and the advantage will be demonstrated only when the project is extremely complex or requires multi-level management. Using the workflow of commanders and adjutants, the project manager (commander) can delegate a large number of decentralized integration work to different team leaders, and then coordinate large subsets of code at different times for subsequent integration.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.