Requirement: Sometimes branch creation cannot be created through the command line or web page, such as Jenkins job
Solution: It can be created through the external api of gitlab
Process: Suppose my domain name is abcd, the project name is user, and the project id is 125
- Get help information by requesting this address ( http://gitlab.abc.cn/help/api/README.md )
- Click on branches, you can see how to operate branches through api
3. Get the key, the address is http://gitlab.abc.cn/profile/account, you need to log in
4. Open postman to get all branches of the user project
5. How did the project id125 get it?
It is globally unique, and the way I know currently is to search for project-id by opening the project and then opening F12
6. Creating a branch through api is similar, note that it is a post request