准备

首先三个分支
master
devlop
test

操作流程

image.png

拉取master分支

  1. git clone http://git.imile.com/devops/k8s-cicd.git

image.png

切换到test分支

  1. cd k8s-cicd
  2. git branch -a

image.png

  1. git checkout -b test remotes/origin/test

模拟操作

提交一个commit

  1. echo "test" > test.txt
  2. git add test.txt
  3. git commit -m "add test.txt"

image.png

将test分支推送到远程分支上

  1. git push origin test

image.png

打tag并push

以2020-12-16 12:12:30 作为tag

  1. git tag 20201216121230
  2. git push origin --tags

image.png
gitlab上可以看到tag
image.png

merge到devlop上

  1. git checkout -b develop remotes/origin/develop
  2. git merge test
  3. git push origin develop

image.png

merge到master上

  1. git checkout master
  2. git merge test
  3. git push origin master

image.png