git cross team cooperation

Posted by feelay on Mon, 24 Jan 2022 22:10:02 +0100

git series article directory

Chapter VII git cross team cooperation

preface

Previously, we introduced collaborative development within the company, and this chapter introduces cross company collaborative development

1, Cross team cooperation process?

1. Company a has project managers and programmers. Now join the programmers of company B for cross team cooperation.

2. Programmers of company B first need to know the warehouse address of programmers of company a, which is usually sent to programmers of company B by the project manager of company A

3. The programmer fork of company B develops the code warehouse

4. Finally, the warehouse of company B is merged with the warehouse of company A

2, Use steps

1. First introduce the programmers and warehouses of company B

1. The project manager of company a will give the warehouse address to the programmer fork of company B

Here is the way to use gitee, basically the same

2. The programmer of company B will clone the fork warehouse to the local warehouse

Don't clone wrong here. Clone from the programmer warehouse of company B to the local programmer warehouse of company B
The code is as follows (example):

Apple@DESKTOP-OK1UFD6 MINGW64 ~/Desktop/gitRes
$ git clone https://gitee.com/gitee13913150025/git-resp.git
Cloning into 'git-resp'...
remote: Enumerating objects: 18, done.
remote: Counting objects: 100% (18/18), done.
remote: Compressing objects: 100% (8/8), done.
remote: Total 18 (delta 4), reused 18 (delta 4), pack-reused 0
Receiving objects: 100% (18/18), done.
Resolving deltas: 100% (4/4), done.

Apple@DESKTOP-OK1UFD6 MINGW64 ~/Desktop/gitRes
$

Then the programmer of company B writes his own function code

3. The programmer of company B will complete the code of the local warehouse and then push it to the remote warehouse of company B

Here is a new test2 Txt demo, and then submit it to the local warehouse and push it to the remote warehouse of your company

Apple@DESKTOP-OK1UFD6 MINGW64 ~/Desktop/gitRes/git-resp (master)
$ git add Test2.txt

Apple@DESKTOP-OK1UFD6 MINGW64 ~/Desktop/gitRes/git-resp (master)
$ git commit -m "B Company programmers modified Test2.txt,Used to demonstrate cross company collaboration" Test2.txt
[master 8b8e74a] B Company programmers modified Test2.txt,Used to demonstrate cross company collaboration
 1 file changed, 1 insertion(+)
 create mode 100644 Test2.txt

Apple@DESKTOP-OK1UFD6 MINGW64 ~/Desktop/gitRes/git-resp (master)
$ git push https://gitee.com/gitee13913150025/git-resp.git
Enumerating objects: 4, done.
Counting objects: 100% (4/4), done.
Delta compression using up to 4 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 401 bytes | 401.00 KiB/s, done.
Total 3 (delta 1), reused 0 (delta 0), pack-reused 0
remote: Powered by GITEE.COM [GNK-6.2]
To https://gitee.com/gitee13913150025/git-resp.git
   fd1a1b6..8b8e74a  master -> master

Apple@DESKTOP-OK1UFD6 MINGW64 ~/Desktop/gitRes/git-resp (master)
$


Here, the programmer of company B submitted the code to his company's remote warehouse

4. Merge the warehouse of company B and the warehouse of company A


Step 1: the programmer of company B performs the pull request operation

Just wait after submitting it and wait for the review of the project manager of company A.

The second department is reviewed by the project manager of company A

The project manager requires the programmer of company B to confirm again

The programmer of company B confirmed that there was no problem and asked to go online!

Then the project manager of company A reviews the test and passes the post point consolidation

Step 3 merge

Step 4: the project manager of company A checks the warehouse of company A after merging, and Test2 is merged successfully

The url used here is the data requested by the network.

summary

This article only briefly introduces the most basic use of cross company git, which can enable us to quickly and easily deal with the consolidation method of multiple remote warehouses.

Topics: Java git github