CICD 持续集成与持续交付——git

git使用

[root@cicd1 ~]# yum install -y git[root@cicd1 ~]# mkdir demo[root@cicd1 ~]# cd demo/

初始化版本库

[root@cicd1 demo]# git init

查看状态

[root@cicd1 demo]# git status[root@cicd1 demo]# git status  -s #简化输出

[root@cicd1 demo]# echo test > README.md[root@cicd1 demo]# ls[root@cicd1 demo]# git status -s

[root@cicd1 demo]# git add README.md[root@cicd1 demo]# git status  -s

[root@cicd1 demo]# git config --global user.email "924023742@qq.com"[root@cicd1 demo]# git config --global user.name "hjl"[root@cicd1 demo]# git commit -m "add README.md"

[root@cicd1 demo]# echo hello >> README.md[root@cicd1 demo]# git status -s

[root@cicd1 demo]# git add README.md[root@cicd1 demo]# git status -s

[root@cicd1 demo]# echo world >> README.md[root@cicd1 demo]# git status -s


 

[root@cicd1 demo]# git commit -m "v1"[root@cicd1 demo]# git status -s

[root@cicd1 demo]# git add .[root@cicd1 demo]# git status -s[root@cicd1 demo]# git commit -m "v2"[root@cicd1 demo]# git status -s

忽略隐藏文件

[root@cicd1 demo]# touch .a[root@cicd1 demo]# git status -s

[root@cicd1 demo]# vim .gitignore

[root@cicd1 demo]# git status -s

[root@cicd1 demo]# echo helloworld > test.txt[root@cicd1 demo]# git add test.txt[root@cicd1 demo]# git commit -m "add test.txt"

撤销文件修改

[root@cicd1 demo]# rm -f test.txt[root@cicd1 demo]# git status -s[root@cicd1 demo]# git checkout -- test.txt

取消暂存区文件

[root@cicd1 demo]# git rm test.txt[root@cicd1 demo]# git status  -s[root@cicd1 demo]# git reset HEAD test.txt

版本回退

[root@cicd1 demo]# git rm test.txt[root@cicd1 demo]# git commit -m "delete test.txt"[root@cicd1 demo]# git reflog[root@cicd1 demo]# git reset --hard 110c7e6

github远程代码仓库

登录:https://github.com/

上传公钥

[root@cicd1 ~]# ssh-keygen[root@cicd1 ~]# cat .ssh/id_rsa.pub

推送仓库

[root@cicd1 ~]# cd demo/[root@cicd1 demo]# git branch -M main[root@cicd1 demo]# git remote add origin git@github.com:he-bao/demo.git[root@cicd1 demo]# git remote -v[root@cicd1 demo]# git push -u origin main

克隆仓库

[root@cicd1 ~]# rm -fr demo/[root@cicd1 ~]# git clone git@github.com:he-bao/demo.git[root@cicd1 ~]# cd demo/[root@cicd1 demo]# ls

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.hqwc.cn/news/195975.html

如若内容造成侵权/违法违规/事实不符,请联系编程知识网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

前端调取摄像头并实现拍照功能

前言 最近接到的一个需求十分有意思,设计整体实现了前端仿 微信扫一扫 的功能。整理了一下思路,做一个分享。 tips: 如果想要实现完整扫一扫的功能,你需要掌握一些前置知识,这次我们先讲如何实现拍照并且保存的功能。 一. wind…

深度学习中的图像融合:图像融合论文阅读与实战

个人博客:Sekyoro的博客小屋 个人网站:Proanimer的个人网站 abs 介绍图像融合概念,回顾sota模型,其中包括数字摄像图像融合,多模态图像融合, 接着评估一些代表方法 介绍一些常见应用,比如RGBT目标跟踪,…

交易机器人-微信群通知

微信公众号:大数据高性能计算 1 背景 背景是基于人工去做交易本身无法做到24小时无时无刻的交易,主要是虚拟币本身它是24小时交易,人无法做到24小时盯盘,其次就是如果你希望通过配置更加复杂的规则甚至需要爬取最新的信息走模型进行量化交易的时候,就需要自己去做一些量化…

【Django-DRF用法】多年积累md笔记,第(4)篇:Django-DRF反序列化详解

本文从分析现在流行的前后端分离Web应用模式说起,然后介绍如何设计REST API,通过使用Django来实现一个REST API为例,明确后端开发REST API要做的最核心工作,然后介绍Django REST framework能帮助我们简化开发REST API的工作。 全…

容斥 C. Strange Function改编题

补题: 题目详情 - 9.段坤爱取模%%% - SUSTOJ 本题或许是参考 Problem - C - Codeforces 根据题意,f(i)就是不能被整除的最小的一个质因子。 打表发现,当15个质因子相乘后,长度就大于18。 因此可以知道小于等于1e16内的正整数x…

【开源】基于Vue.js的企业项目合同信息系统

目录 一、摘要1.1 项目介绍1.2 项目录屏 二、功能模块2.1 数据中心模块2.2 合同审批模块2.3 合同签订模块2.4 合同预警模块2.5 数据可视化模块 三、系统设计3.1 用例设计3.2 数据库设计3.2.1 合同审批表3.2.2 合同签订表3.2.3 合同预警表 四、系统展示五、核心代码5.1 查询合同…

C语言:结构体

目录 结构体类型的声明 匿名结构体 全局结构体变量 嵌套结构体 访问结构体成员 结构的自引用 结构体变量的定义和初始化 结构体内存对齐 结构体内存对齐规则 修改默认对齐数 #pragma pack(n) offsetof 求结构体成员相对于结构体开头的偏移量的宏。 为什么存在内存…

【计算思维】蓝桥杯STEMA 科技素养考试真题及解析 4

1、下列哪个选项填到填到下图空缺处最合适 A、 B、 C、 D、 答案:D 2、按照如下图的规律摆放正方形,第 5 堆正方形的个数是 A、13 B、14 C、15 D、16 答案:D 3、从右面观察下面的立体图形,看到的是 A、 B、 C、 D、 答…

C语言——操作符详解

前言:这篇文章主要讲解一下C语言中常见的操作符的使用,做一下整理,便于日后回顾,同时也希望能帮助到大家。 🎬个人简介:努力学习ing 📝CSDN主页 愚润求学 🌄每日鸡汤:念…

ClickHouse数据一致性

查询CK手册发现,即便对数据一致性支持最好的Mergetree,也只是保证最终一致性: 我们在使用 ReplacingMergeTree、SummingMergeTree 这类表引擎的时候,会出现短暂数据不一致的情况。 在某些对一致性非常敏感的场景,通常有…

c语言-输入输出详解

文章目录 格式化输入输出占位符printfscanf 字符串输入输出puts&#xff08;&#xff09;gets&#xff08;&#xff09; 字符输入输出putchar&#xff08;&#xff09;getchar&#xff08;&#xff09; 区别 格式化输入输出 输入输出的库函数的头文件&#xff1a; #include<…

原理Redis-动态字符串SDS

动态字符串SDS Redis中保存的Key是字符串&#xff0c;value往往是字符串或者字符串的集合。可见字符串是Redis中最常用的一种数据结构。 不过Redis没有直接使用C语言中的字符串&#xff0c;因为C语言字符串存在很多问题&#xff1a; 获取字符串长度的需要通过运算非二进制安全…