创建代码库

基本属性信息配置

image-20220105163850736

业务属性信息配置

image-20220105164052921

分支对应项目

最新对应关系见: 腾讯共享文档:代码库(数据侧)

项目数据侧代码库分支名称负责人
月经分三期优化四批需求http://10.124.128.2:8888/jf/sj/dw40.gitdw40_3320_20220114任宇鹏
5G套餐受理http://10.124.128.2:8888/jf/sj/dw40.gitdw40_3321_20220114宙蓉
永洪报表重构配合梳理事项http://10.124.128.2:8888/jf/sj/dw40.gitdw40_3429_20220114康广月、冯晋华、、陈谈、陈政

代码上传

代码上传流程图

代码上传流程图

工具准备

Git官网下载](https://git-scm.com/download/win))Git加速下载

安装包一直点击下一步,傻瓜式安装😪

用户信息配置

git config --global user.name "名字" #输入姓名
git config --global user.email xxx@xxx.com  #输入邮箱信息

克隆代码库到本地

  • 准备存放代码库的文件夹,右键执行<font color="red">Git Bash Here</font>

  • 执行语句 <font color="red">git clone 代码库链接</font>

  • 输入天梯账号和密码,验明身份

  • 成功克隆到本地

切换到要上传的分支

查看分支列表

fanxin@Z2Air MINGW64 /d/BoncItems/Unicom/代码库/dw40 (master)
$ git branch -r
# 以下为分支列表示意
  origin/HEAD -> origin/master
  origin/dw40_3320_20220114
  origin/dw40_3321_20220114
  origin/dw40_3325_20220114
  origin/dw40_3328_20220114
  origin/dw40_3332_20220114
  origin/master
  origin/release_20220114

切换分支

fanxin@Z2Air MINGW64 /d/BoncItems/Unicom/代码库/dw40 (master)
$ git checkout dw40_3320_20220114
Switched to a new branch 'dw40_3320_20220114'
Branch 'dw40_3320_20220114' set up to track remote branch 'dw40_3320_20220114' from 'origin'.

拉取远端代码

fanxin@Z2Air MINGW64 /d/BoncItems/Unicom/代码库/dw40 (dw40_3320_20220114)
$ git pull
Already up to date.

添加对应代码

复制粘贴对应文件

添加文件到暂存区

fanxin@Z2Air MINGW64 /d/BoncItems/Unicom/代码库/dw40 (dw40_3320_20220114)
$ git add .

提交代码

添加注释信息

fanxin@Z2Air MINGW64 /d/BoncItems/Unicom/代码库/dw40 (dw40_3320_20220114)
$ git commit -m "月经分三期优化四批需求:三期Cube脚本"
[dw40_3320_20220114 ca302c7] 月经分三期优化四批需求:三期Cube脚本
 15 files changed, 4448 insertions(+)
 create mode 100644 P_DM_C_M_3000M_KDRH_BASE.sh
 create mode 100644 P_DM_C_M_CUS_STOCK_KDPZ_BASE.sh
 create mode 100644 P_DM_C_M_CUS_STOCK_PZ_BASE.sh
 create mode 100644 P_DM_C_M_CUS_STOCK_YDPZ_BASE.sh
 create mode 100644 P_DM_C_M_DEV_YDRH_BASE.sh
 create mode 100644 P_DM_C_M_DEV_YD_PZ_BASEN.sh
 create mode 100644 P_DM_C_M_DEV_YD_PZ_NEW_BASE.sh
 create mode 100644 P_DM_C_M_DEV_YD_SNAP_USER.sh
 create mode 100644 P_DM_C_M_KD_USER_CHARGE.sh
 create mode 100644 P_DM_C_M_KYRH_YD_BASE.sh
 create mode 100644 P_DM_C_M_YDDEV_BASE.sh
 create mode 100644 P_DM_C_M_YDDYHY_BASE.sh
 create mode 100644 P_DM_C_M_YDHY_BASE.sh
 create mode 100644 P_DM_C_M_YD_BASE_LVL.sh
 create mode 100644 "\346\234\210\347\273\217\345\210\206\344\274\232cube\350\204\232\346\234\254\350\241\200\347\274\230\345\205\263\347\263\273\346\242\263\347\220\206.xlsx"

推送代码

fanxin@Z2Air MINGW64 /d/BoncItems/Unicom/代码库/dw40 (dw40_3320_20220114)
$ git push
Enumerating objects: 18, done.
Counting objects: 100% (18/18), done.
Delta compression using up to 12 threads
Compressing objects: 100% (17/17), done.
Writing objects: 100% (17/17), 42.21 KiB | 6.03 MiB/s, done.
Total 17 (delta 6), reused 0 (delta 0), pack-reused 0
remote:
remote: To create a merge request for dw40_3320_20220114, visit:
remote:   http://10.124.128.2:8888/jf/sj/dw40/merge_requests/new?merge_request%5Bsource_branch%5D=dw40_3320_20220114
remote:
To http://10.124.128.2:8888/jf/sj/dw40.git
   aa4d39f..ca302c7  dw40_3320_20220114 -> dw40_3320_20220114

合并分支

image-20220106142428602

异常处理

HTTPS connections may not be secure

当使用 git clone http地址 时,可能会报 HTTPS connections may not be secure 错误提示,这时候需要执行 $ git config --global http.sslVerify true 开启安全认证,之后再次执行 git clone 即可正常克隆代码到本地。

fanxin@Z2Air MINGW64 /d/BoncItems/Unicom/代码库
$ git clone http://10.124.128.2:8888/jf/sj/dw40.git
Cloning into 'dw40'...
warning: ----------------- SECURITY WARNING ----------------
warning: | TLS certificate verification has been disabled! |
warning: ---------------------------------------------------
warning: HTTPS connections may not be secure. See https://aka.ms/gcmcore-tlsverify for more information.
warning: ----------------- SECURITY WARNING ----------------
warning: | TLS certificate verification has been disabled! |
warning: ---------------------------------------------------
warning: HTTPS connections may not be secure. See https://aka.ms/gcmcore-tlsverify for more information.
remote: HTTP Basic: Access denied
fatal: Authentication failed for 'http://10.124.128.2:8888/jf/sj/dw40.git/'

fanxin@Z2Air MINGW64 /d/BoncItems/Unicom/代码库
$ git config --global http.sslVerify true

fanxin@Z2Air MINGW64 /d/BoncItems/Unicom/代码库
$ git clone http://10.124.128.2:8888/jf/sj/dw40.git

附录

Last modification:May 18th, 2022 at 04:45 pm
如果觉得我的文章对你有用,请随意赞赏