![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Git
51DevOps-刺天冬
当你发现自己的才华撑不起野心时,就请安静下来学习吧!
展开
-
Git标签使用
给最近的一次提交打个便签[root@git ~/git_test]# git log --oneline 426d222 modify c.txt merge master and qls428aecf modify c.txt mastera49ccaf modify c.txt qls76cd6d4 add new d.txt master1520f92 add new qls.txt qlscd9d652 modify a.txt 3f88afdb modify a.txt 2.原创 2020-05-12 17:47:23 · 108 阅读 · 0 评论 -
Git的分支应用
Git 的分支,其实本质上仅仅是指向提交对象的可变指针。 主分支master 在企业中,master分支是要非常稳定的,不能直接修改master分支里面的内容,使用的时候创建一个普通分支,等完成工作之后,将其合并到master分支上。[root@git ~/git_test]# git log --oneline --decoratecd9d652 (HEAD, master) modify a.txt 3 #当前的指针指向了masterf88afdb modify a.txt 2原创 2020-05-12 17:46:48 · 152 阅读 · 0 评论 -
Git恢复数据
#1.改变了工作目录中的文件,没有添加到暂存区 [root@git ~/git_test]# echo "222222222" >>a.txt [root@git ~/git_test]# cat a.txt111111111222222222[root@git ~/git_test]# git diff .diff --git a/a.txt b/a.txtindex bb81b3c..61eb21a 100644--- a/a.txt+++ b/a.txt@@ -1原创 2020-05-11 21:15:57 · 121 阅读 · 0 评论 -
Git的历史操作记录
#查看Git的历史操作记录 commit提交一次 就会记录一次日志 [root@git ~/git_test]# git logcommit 8e84d3462fce9f1fe6b56a190b1a515212c2fe5fAuthor: qls <qls@qq.com>Date: Mon May 11 15:20:08 2020 +0800 modify a.txt 1commit 51104b96b305351bcbf08ddbd83cb7167c65855原创 2020-05-11 21:15:16 · 299 阅读 · 0 评论 -
Git文件内容的比对
git status 只能查看区域状态的不同,不能查看文件的内容不同之处 [root@git ~/git_test]# git status# On branch master# Changes not staged for commit:# (use "git add <file>..." to update what will be committed)# (use "git checkout -- <file>..." to discard chang.原创 2020-05-11 21:09:31 · 300 阅读 · 0 评论 -
Git如何将文件重命名
#第一种方法#1. 本地重命名 [root@git ~/git_test]# git status# On branch master# Changes not staged for commit:# (use "git add/rm <file>..." to update what will be committed)# (use "git checkout -- <file>..." to discard changes in working direc原创 2020-05-11 21:08:23 · 237 阅读 · 0 评论 -
Git删除暂存区的文件和工作目录中的文件
#第一种方法:#1.先删除暂存区中的文件[root@git ~/git_test]# git rm --cached a.txtrm 'a.txt'[root@git ~/git_test]# git status# On branch master## Initial commit## Changes to be committed:# (use "git rm --cached <file>..." to unstage)## new file: b.tx原创 2020-05-11 21:07:10 · 367 阅读 · 0 评论 -
Git添加及提交数据到暂存区及本地仓库
#显示Git当前仓库的状态 [root@git ~/git_test]# git status # On branch master #位于master分支## Initial commit #初始的提交#nothing to commit (create/copy files and use "git add" to track)#没有任何提交 创建或者拷贝文件和使用git add 命令进行建立跟踪#在工作目录中创建几个测试文件[root@git ~/git_test]原创 2020-05-11 21:06:00 · 922 阅读 · 0 评论 -
Git的安装部署
#环境准备 [root@git ~]# cat /etc/redhat-release CentOS Linux release 7.6.1810 (Core) [root@git ~]# uname -r3.10.0-957.el7.x86_64[root@git ~]# getenforce Disabled[root@git ~]# iptables-save [root@git ~]# dateMon May 11 11:53:23 CST 2020[root@git ~]#.原创 2020-05-11 21:04:36 · 113 阅读 · 0 评论 -
Git区域组成及四种状态
Git区域组成: 工作目录 暂存区域 本地仓库 远程仓库 Git四种状态 Untracked 未跟踪 Unmodified 未修改 Modified 已修改 Staged 已暂存原创 2020-05-11 21:03:16 · 122 阅读 · 0 评论