Linux学习-HIS系统部署(1)
Git安装
#安装中文支持(选做)
[root@Programer ~]# echo $LANG #查看当前系统语言及编码
en_US.UTF-8
[root@Programer ~]# yum -y install langpacks-zh_CN.noarch #安装中文支持
[root@Programer ~]# vim /etc/locale.conf #配置系统使用中文及编码
[root@Programer ~]# cat /etc/locale.conf
LANG="zh_CN.UTF-8"
[root@Programer ~]# reboot #重启使语言配置生效[root@Programer ~]# echo $LANG #确认使用中文编码
zh_CN.UTF-8
[root@Programer ~]# #yum源中集成了Git软件包,使用yum安装Git
[root@Programer ~]# yum clean all; yum repolist -v #插件yum源是否可用
...
Total packages: 8,265
[root@Programer ~]# yum -y install git #使用yum安装Git
...
Complete!
[root@Programer ~]# git --version #查看Git版本
git version 2.31.1
[root@Programer ~]# git --help #查看Git命令帮助信息
Git工作流程
Git基础配置
# Git基础配置
--local:仓库级
--global:全局级
--system:系统级
# 设置用户名
[root@programer ~]# git config --global user.name xuwenpeng3
# 设置用户信箱
[root@programer ~]# git config --global user.email xuwenpeng3@163.com
# 设置版本库默认分支
[root@programer ~]# git config --global init.defaultBranch master
# 查看已有Git配置
[root@programer ~]# git config --list
user.name=xuwenpeng3
user.email=xuwenpeng3@163.com
init.defaultbranch=master
# 查看Git配置持久化文件
[root@programer ~]# cat ~/.gitconfig
[user]name = xuwenpeng3email = xuwenpeng3@163.com
[init]defaultBranch = master
Git创建版本库
# ------Git初始化空版本库
[root@programer ~]# ls
# 初始化空版本库
[root@programer ~]# git init myproject
Initialized empty Git repository in /root/myproject/.git/
[root@programer ~]# ls
myproject
# 查看版本库信息
[root@programer ~]# ls -a myproject/
. .. .git
[root@programer ~]# ls -a myproject/.git
. .. HEAD branches config description hooks info objects refs
# ------将已胡目录制作成版本库
[root@programer ~]# mkdir mytest
[root@programer ~]# ls -a mytest
. ..
[root@programer ~]# cd mytest
# 将已有空的目录初使化为git库
[root@programer mytest]# git init
Initialized empty Git repository in /root/mytest/.git/
[root@programer mytest]# ls -a
. .. .git
[root@programer mytest]# ls -a .git
. .. HEAD branches config description hooks info objects refs
Git版本库操作
# Git基础命令使用
[root@programer ~]# cd myproject/
[root@programer myproject]# git status
On branch masterNo commits yetnothing to commit (create/copy files and use "git add" to track)
# 创建readme文件
[root@programer myproject]# echo "Learning Git" >> readme.md
[root@programer myproject]# ls
readme.md
[root@programer myproject]# git status
On branch masterNo commits yetUntracked files:(use "git add <file>..." to include in what will be committed)readme.mdnothing added to commit but untracked files present (use "git add" to track)
# 将文件信息添加到暂存区
[root@programer myproject]# git add readme.md
# 查看Git本地仓库状态
[root@programer myproject]# git status
On branch masterNo commits yetChanges to be committed:(use "git rm --cached <file>..." to unstage)new file: readme.md
# 将暂停区文件提交到本地仓库
[root@programer myproject]# git commit -m "add readme"
[master (root-commit) 6c7fa0a] add readme1 file changed, 1 insertion(+)create mode 100644 readme.md
[root@programer myproject]# git status
On branch master
nothing to commit, working tree clean
Git版本库查询
# 查看本地Git版本库信息
[root@programer myproject]# git log # 本地版本库提交记录
commit 6c7fa0a66645eb2dfa9c9f75f0cb1237b39a9489 (HEAD -> master)
Author: xuwenpeng3 <xuwenpeng3@163.com>
Date: Wed Sep 20 10:18:02 2023 +0800add readme
# 本地版本库提交记录(简略)
[root@programer myproject]# git log --pretty=oneline
6c7fa0a66645eb2dfa9c9f75f0cb1237b39a9489 (HEAD -> master) add readme
# 本地版本库提交记录(极简)
[root@programer myproject]# git log --oneline
6c7fa0a (HEAD -> master) add readme
Git练习(生成多个版本)
[root@programer ~]# cd myproject
# 创建test.txt文件
[root@programer myproject]# echo 123 > test.txt
# 添加test.txt至暂存区
[root@programer myproject]# git add test.txt
# 生成新版本
[root@programer myproject]# git commit -m "add test.txt"
[master f20ee5f] add test.txt1 file changed, 1 insertion(+)create mode 100644 test.txt
[root@programer myproject]# echo 456>test.txt[root@programer myproject]# git add .
[root@programer myproject]# git commit -m "modify test.txt"
[master e88a5ff] modify test.txt1 file changed, 1 deletion(-)
[root@programer myproject]# echo 789 > test.txt
[root@programer myproject]# git commit -m "done test.txt"
On branch master
Changes not staged for commit:(use "git add <file>..." to update what will be committed)(use "git restore <file>..." to discard changes in working directory)modified: test.txtno changes added to commit (use "git add" and/or "git commit -a")
[root@programer myproject]# git add ./
[root@programer myproject]# git commit -m "done test.txt"
[master d4a95fa] done test.txt1 file changed, 1 insertion(+)
[root@programer myproject]# git log --pretty=oneline
d4a95face5c9725263596ff340dcf9f2dd0e2552 (HEAD -> master) done test.txt
e88a5ff574fd24416de7e5834f5ef2144502f8dc modify test.txt
f20ee5f0034d7866381dcdd14bc09168f4563b0f add test.txt
6c7fa0a66645eb2dfa9c9f75f0cb1237b39a9489 add readme
[root@programer myproject]# git log --oneline
d4a95fa (HEAD -> master) done test.txt
e88a5ff modify test.txt
f20ee5f add test.txt
6c7fa0a add readme
Git指针操作
查看Git指针信息
# 使用git log命令查看HEAD指针
[root@programer ~]# cd myproject
# 查看git指针
[root@programer myproject]# git log --pretty=oneline
d4a95face5c9725263596ff340dcf9f2dd0e2552 (HEAD -> master) done test.txt
e88a5ff574fd24416de7e5834f5ef2144502f8dc modify test.txt
f20ee5f0034d7866381dcdd14bc09168f4563b0f add test.txt
6c7fa0a66645eb2dfa9c9f75f0cb1237b39a9489 add readme
[root@programer myproject]# cat test.txt
789
利用指针实现Git版本还原
# reset子命令用于版本还原
--soft:缓存区和工作目录不受影响,reset后分支和HEAD指针移动到指定的commit,代码文件和reset之前一样,修改部分已加入到暂存区,通常用于重新提交。
--mixed:(默认)工作目录不受影响,reset后分支的HEAD指针移动到指定位置,代码文件内容和reset之前一样,修改部分未加入到暂存区
--hard:工作目录,缓存区均受影响。reset后分支和HEAD指针移动到指定commit,代码文件内容回退到指定commit,工作空间为clean状态。通常用于获取指定版本的代码文件
# 还原到指定版本
[root@programer myproject]# git reset --hard 1c2535a7c2
HEAD is now at 1c2535a modify test.txt
# 确认HEAD指针移动
[root@programer myproject]# git log --oneline
1c2535a (HEAD -> master) modify test.txt
5dc6adb add test.txt
023dbd9 add readme
[root@programer myproject]# cat test.txt
456#reflog子命令用于获取HEAD指针移动轨迹
[root@programer myproject]# git reflog
1c2535a (HEAD -> master) HEAD@{0}: reset: moving to 1c2535a7c2
dc4b5a8 HEAD@{1}: commit: done test.txt
1c2535a (HEAD -> master) HEAD@{2}: commit: modify test.txt
5dc6adb HEAD@{3}: commit: add test.txt
023dbd9 HEAD@{4}: commit (initial): add readme
[root@programer myproject]# git reflog
dc4b5a8 (HEAD -> master) HEAD@{0}: reset: moving to dc4b5a8
1c2535a HEAD@{1}: reset: moving to 1c2535a7c2
dc4b5a8 (HEAD -> master) HEAD@{2}: commit: done test.txt
1c2535a HEAD@{3}: commit: modify test.txt
5dc6adb HEAD@{4}: commit: add test.txt
023dbd9 HEAD@{5}: commit (initial): add readme
[root@programer myproject]# cat test.txt
789
Git分支操作
# 查看当前分支信息,branch子命令
# 查看本地Git仓库信息
[root@programer myproject]# git status
On branch master
nothing to commit, working tree clean
# 查看分支信息
[root@programer myproject]# git branch -v
* master dc4b5a8 done test.txt
# 创建hotfix分支
[root@programer myproject]# git branch hotfix
[root@programer myproject]# git branch feature
[root@programer myproject]# git branch -vfeature dc4b5a8 done test.txthotfix dc4b5a8 done test.txt
* master dc4b5a8 done test.txt
# 切换分支
[root@programer myproject]# git checkout hotfix
Switched to branch 'hotfix'
[root@programer myproject]# git branch -vfeature dc4b5a8 done test.txt
* hotfix dc4b5a8 done test.txtmaster dc4b5a8 done test.txt
[root@programer myproject]# git checkout feature
Switched to branch 'feature'
[root@programer myproject]# git branch -v
* feature dc4b5a8 done test.txthotfix dc4b5a8 done test.txtmaster dc4b5a8 done test.txt
[root@programer myproject]# git branch develop
[root@programer myproject]# git branch -vdevelop dc4b5a8 done test.txt
* feature dc4b5a8 done test.txthotfix dc4b5a8 done test.txtmaster dc4b5a8 done test.txt
# 删除develop分支
[root@programer myproject]# git branch -d develop
Deleted branch develop (was dc4b5a8).
[root@programer myproject]# git branch -v
* feature dc4b5a8 done test.txthotfix dc4b5a8 done test.txtmaster dc4b5a8 done test.txt
Git合并分支
# 无冲突分支合并
# 切换到hotfix分支
[root@programer myproject]# git checkout hotfix
Switched to branch 'hotfix'
[root@programer myproject]# echo haha>haha.txt
# 添加haha到暂存区
[root@programer myproject]# git add .
# 生成新版本
[root@programer myproject]# git commit -m "add haha.txt"
[hotfix 49461bb] add haha.txt1 file changed, 1 insertion(+)create mode 100644 haha.txt
[root@programer myproject]# ls
haha.txt readme.md test.txt
# 切换到master分支
[root@programer myproject]# git checkout master
Switched to branch 'master'
[root@programer myproject]# echo xixi>xixi.txt
#添加至暂存区
[root@programer myproject]# git add .
[root@programer myproject]# git commit -n "add xixi.txt"
error: pathspec 'add xixi.txt' did not match any file(s) known to git
[root@programer myproject]# git commit -m "add xixi.txt"
[master fd88497] add xixi.txt1 file changed, 1 insertion(+)create mode 100644 xixi.txt
[root@programer myproject]# git branch -vfeature dc4b5a8 done test.txthotfix 49461bb add haha.txt
* master fd88497 add xixi.txt
# 合并hotfix分支到master分支
[root@programer myproject]# git merge hotfix
Merge made by the 'recursive' strategy.haha.txt | 1 +1 file changed, 1 insertion(+)create mode 100644 haha.txt
[root@programer myproject]# ls
haha.txt readme.md test.txt xixi.txt
[root@programer myproject]# cat haha.txt
haha
[root@programer myproject]# cat xixi.txt
xixi
[root@programer myproject]# git checkout hotfix
Switched to branch 'hotfix'
[root@programer myproject]# echo "hahaha">a.txt
[root@programer myproject]# git add .
[root@programer myproject]# git commit -m "hotfix"
[hotfix 3be70ac] hotfix1 file changed, 1 insertion(+)create mode 100644 a.txt
[root@programer myproject]# git branch -vfeature dc4b5a8 done test.txt
* hotfix 3be70ac hotfixmaster 416f3d7 Merge branch 'hotfix'
[root@programer myproject]# git checkout master
Switched to branch 'master'
[root@programer myproject]# git branch -vfeature dc4b5a8 done test.txthotfix 3be70ac hotfix
* master 416f3d7 Merge branch 'hotfix'
[root@programer myproject]# echo "xixixi">a.txt
[root@programer myproject]# git add .
[root@programer myproject]# git commit -m "master"
[master 93e8350] master1 file changed, 1 insertion(+)create mode 100644 a.txt# 有冲突分支合并(修改不同分支中相同文件的相同行)
[root@programer myproject]# git merge hotfix
CONFLICT (add/add): Merge conflict in a.txt
Auto-merging a.txt
Automatic merge failed; fix conflicts and then commit the result.
[root@programer myproject]# cat a.txt
<<<<<<< HEAD
xixixi
=======
hahaha
>>>>>>> hotfix
# 将a.txt文件内容合并成如下
[root@programer myproject]# vim a.txt
xixixi
hahaha
[root@programer myproject]# git add .
[root@programer myproject]# git commit -m "resolv conflict"
[master a35cf84] resolv conflict
[root@programer myproject]#
Git标签操作
# 使用tag子命令管理标签
# 查看已有标签
[root@programer myproject]# git tag
# 创建v1标签
[root@programer myproject]# git tag v1
[root@programer myproject]# git tag
v1
[root@programer myproject]# git tag v2
[root@programer myproject]# git tag
v1
v2
# 删除v2标签
[root@programer myproject]# git tag -d v2
Deleted tag 'v2' (was a35cf84)
相关文章:

Linux学习-HIS系统部署(1)
Git安装 #安装中文支持(选做) [rootProgramer ~]# echo $LANG #查看当前系统语言及编码 en_US.UTF-8 [rootProgramer ~]# yum -y install langpacks-zh_CN.noarch #安装中文支持 [rootProgramer ~]# vim /etc/locale.co…...

Cairo介绍及源码构建安装(3)
接前一篇文章:Cairo介绍及源码构建安装(2) 四、Cairo构建与安装 2. 配置 BLFS中给出的命令为: ./configure --prefix/usr \--disable-static \--enable-tee 这里将“--prefix”选项由“/usr”调整为“/usr/local”&#x…...

Mac电脑信息大纲记录软件 OmniOutliner 5 Pro for Mac中文
OmniOutliner 5 Pro是一款专业级的Mac大纲制作工具,它可以帮助用户更好地组织和管理信息,以及制作精美的大纲。以下是OmniOutliner 5 Pro的主要功能和特点: 强大的大纲组织和管理功能。OmniOutliner 5 Pro为用户提供了多层次的大纲结构&…...

linux设置应用开机自启(通用:mysql、jar、nginx、solr...)
1. 业务场景 用于单机生产环境,防止服务器断电或者强制重启导致的服务下线。 2. 实现方案 对于无状态服务,可容器部署设置 restart: always,systemctl eable docker对于有状态服务,可编写自启脚本,如下 ① 编写执行…...

Offset Explorer(Kafka消息可视化工具)报invalid hex digit ‘{‘错误解决方法
解决办法: 根据代码的实际情况,设置成对应的值。设置完成后点update、refresh更新。...

深度学习:模型训练过程中Trying to backward through the graph a second time解决方案
1 问题描述 在训练lstm网络过程中出现如下错误: Traceback (most recent call last):File "D:\code\lstm_emotion_analyse\text_analyse.py", line 82, in <module>loss.backward()File "C:\Users\lishu\anaconda3\envs\pt2\lib\site-packag…...

【数值计算方法】非线性方程(组)和最优化问题的计算方法:非线性方程式求根的二分法、迭代法、Newton 迭代法及其Python实现
目录 一、非线性方程式求根 1、二分法(Bisection Method、对分法) a. 理论简介 b. python实现 2、迭代法(Iterative Method) a. 理论简介 b. python实现 3、Newton 迭代法(Newtons Method) a. 理论…...

linux主机名
title: linux主机名 createTime: 2020-10-29 18:05:52 updateTime: 2020-10-29 18:05:52 categories: linux tags: Linux系统的主机名 查询主机名 hostnamehostnamectl 修改主机名 hostnamectl set-hostname <newhostname>...

前端uniapp图片select联动文本切换
图片 代码 <template><!-- 这个是uniapp的下拉框 --><uni-data-select v-model"pay_type" :localdata"range" change"handleSelectChange"></uni-data-select><!-- 图片 --><image :src"dynamicImage&qu…...

java - 包装类
目录 前言 一 什么是包装类? 1.获取包装类的两种方式(了解)(已经淘汰) 2.两种方式获取对象的区别(掌握) 3.自动装箱&&自动装箱 4.Integer常用方法 总结 前言 大家好,今天给大家讲解一下包装类 一 什么是包装类? 在Java中,每个基本数据类型都有对应…...

防火墙基础
目录 1、 防火墙支持那些NAT技术,主要应用场景是什么? 2、当内网PC通过公网域名解析访问内网服务器时,会存在什么问题,如何解决? 3、防火墙使用VRRP实现双机热备时会遇到什么问题,如何解决? 4…...

服务断路器_Resilience4j的断路器
断路器(CircuitBreaker)相对于前面几个熔断机制更复杂,CircuitBreaker通常存在三种状态(CLOSE、OPEN、HALF_OPEN),并通过一个时间或数量窗口来记录当前的请求成功率或慢速率,从而根据这些指标来…...

微信小程序学习笔记3.0
第3章 资讯类:仿今日头条微信小程序 3.1 需求描述及交互分析 需求描述 仿今日头条微信小程序,要具有以下功能。 (1)首页新闻频道框架设计,包括底部标签导航设计、新闻检索框设计及新闻频道滑动效果设计。 (2)首页新闻内容设计,包括新闻标题、新闻图片及新闻评论设计…...

nginx 反向代理 负载均衡 动静分离
一样东西的诞生通常都是为了解决某些问题,对于 Nginx 而言,也是如此。 比如,你出于无聊写了一个小网站,部署到 tomcat 之后可以正常访问 但是后来,你的这个小网站因为内容很诱人逐步的火了,用户越来越多&a…...

Codeanalysis(tca)后端二次开发环境搭建
先试用官方脚本文件件quick_install.sh将整个项目启动起来,然后到每个微服务下查看每个服务的pid进程,需要调试哪个先把对应的微服务关闭手动启动,具体启动流程如下: cd 到项目根目录下 source script\config.sh # 激活系统环境…...

JS前端树形Tree数据结构使用
前端开发中会经常用到树形结构数据,如多级菜单、商品的多级分类等。数据库的设计和存储都是扁平结构,就会用到各种Tree树结构的转换操作,本文就尝试全面总结一下。 如下示例数据,关键字段id为唯一标识,pid为父级id&am…...

Automation Anywhere推出新的生成式AI自动化平台,加速提高企业生产力
在9 月 19 日的Imagine 2023 大会上,智能自动化领域的领导者 Automation Anywhere 宣布对其自动化平台进行扩展。推出了新的 Responsible AI Layer,并宣布了四项关键产品更新,包括全新的 Autopilot,它可以利用生成式 AI ÿ…...

电缆隧道在线监测系统:提升电力设施安全与效率的关键
随着城市化进程的加快,电力电缆隧道在保障城市电力供应方面的地位日益重要。然而,电缆隧道环境复杂,容易受到多种因素影响,如温度、湿度、烟雾、水位等,严重威胁电力设施的安全与稳定运行。在此背景下,电缆…...

Java BigDecimal 详解
目录 一、BigDecimal 1、简介 2、构造器描述 3、方法描述 4、使用 一、BigDecimal float和double类型的主要设计目标是为了科学计算和工程计算。他们执行二进制浮点运算,这是为了在广域数值范围上提供较为精确的快速近似计算而精心设计的。然而,它…...
简述信息论与采样定理
信息论 香农信息论发表于1948/1949年,它由三部分组成:信号采样、信源编码、信道编码; 信号采样:采样理论研究在何种条件下对连续信号进行采样,从而得到的离散型号可以可逆地恢复出采样前的连续信号。采样得到的离散实…...

网络安全之网站常见的攻击方式
这是作者自学的哈,不算课程内容。 网页中出现大量黑链 网站看着很正常,但是会隐藏一些链接。网页的链接几乎都是标签,这种黑链就是通过链接标签<a></a>或者script在里面链入恶意脚本,等待浏览者的访问,通…...

iOS Swift 拍照识别数字(Recognizing Text in Images)
可以用腾讯云 OCR的iOS demo - 腾讯云 苹果官方的解决方案(识别度太低) Recognizing Text in Images - apple developer Extracting phone numbers from text in images(Sample Code) - apple developer import UIKit import Visionclass ViewContro…...

数学建模:智能优化算法及其python实现
数学建模:智能优化算法及其python实现 智能优化算法简介差分进化算法(Differential Evolution,DE)遗传算法(Genetic Algorithm,GA)粒子群优化算法(Particle Swarm Optimization,PSO)模拟退火算法(Simulated Annealing,SA)蚁群算法(Ant Colony Optimization,ACO)…...

monkeyrunner环境搭建和初步用法
一、打开模拟器 运行monkeyrunner之前必须先运行相应的模拟器,不然monkeyrunner无法连接设备。 用Elipse打开Android模拟器或在CMD中用Android命令打开模拟器。这里重点讲一下在CMD中用Android命令打开模拟器 命令:emulator -avd test (注…...

2024华为校招面试真题汇总及其解答(一)
1. 我问你点java基础的问题吧,你平时都用什么集合啊,都什么情况下使用 在 Java 中,常用的集合有以下几种: List:有序集合,可以重复,常用实现类有 ArrayList、LinkedList、Vector。Set:无序集合,不能重复,常用实现类有 HashSet、TreeSet。Map:键值对集合,键不能重复…...

css调整字体间距 以及让倾斜字体
调整字体间距 .element {letter-spacing: 2px; /* 调整为适当的值 */ }倾斜字体1 .element {font-style: italic; }请注意,不是所有的字体都有斜体样式可用。如果字体本身没有斜体版本,则可能无法实现完全的斜体效果。 倾斜字体2 <span class"…...

工具篇 | Gradle入门与使用指南 - 附Github仓库地址
介绍 1.1 什么是Gradle? Gradle是一个开源构建自动化工具,专为大型项目设计。它基于DSL(领域特定语言)编写,该语言是用Groovy编写的,使得构建脚本更加简洁和强大。Gradle不仅可以构建Java应用程序&#x…...

使用 Python 函数callable和isinstance的意义
一、说明 在这篇博客中,我们将探讨两个python函数:1 callable 中的函数及其有趣的应用程序。该callable函数用于检查对象是否可调用,这意味着它可以作为函数调用。2 isinstance这个内置函数允许我们比较两种不同的数据类型并确定它们是否相…...

Netty场景及其原理
Netty场景及其原理 Netty简化Java NIO的类库的使用,包括Selector、 ServerSocketChannel、 SocketChannel、ByteBuffer,解决了断线重连、 网络闪断、心跳处理、半包读写、 网络拥塞和异常流的处理等。Netty拥有高性能、 吞吐量更高,延迟更低…...

Java接口和接口继承
Java接口和接口继承 接口 在抽象类中,抽象方法本质上是定义接口规范,即规定高层类的接口,从而保证所有子类都有相同的接口实现,这样,多态就能发挥出威力。 如果一个抽象类没有字段,所有方法全部都是抽象方…...