当前位置: 首页 > news >正文

一级域名建站网站建设行吗网站策划名词解释

一级域名建站网站建设行吗,网站策划名词解释,网页设计与开发实训报告,wordpress改字库一.问题描述 当我们在操作中手误删除了某个分支,那该分支中提交的内容也没有了,我们可以利用git reflog这个命令来查看历史提交的记录从而恢复被删除的分支和提交的内容 二.模拟问题 1.创建git仓库,并提交一个文件 [rootcentos7-temp /da…

一.问题描述

当我们在操作中手误删除了某个分支,那该分支中提交的内容也没有了,我们可以利用git reflog这个命令来查看历史提交的记录从而恢复被删除的分支和提交的内容

二.模拟问题

1.创建git仓库,并提交一个文件

[root@centos7-temp /data]# git init
已初始化空的 Git 仓库于 /data/.git/
[root@centos7-temp /data]# vim test.txt[root@centos7-temp /data]# cat test.txt 
11111
[root@centos7-temp /data]# git add test.txt
[root@centos7-temp /data]# git commit -m "first commit"
[master(根提交) af8a35f] first commit1 file changed, 1 insertion(+)create mode 100644 test.txt

2.再次编辑test.txt文件并提交

[root@centos7-temp /data]# vim test.txt [root@centos7-temp /data]# cat test.txt 
11111
22222
[root@centos7-temp /data]# git add test.txt 
[root@centos7-temp /data]# git commit -m "second commit"
[master 9f10533] second commit1 file changed, 1 insertion(+)

3.查看当前所处分支和提交记录

#可以看到所处分支是在master分支,在master分支中有两条提交记录

[root@centos7-temp /data]# git branch
* master[root@centos7-temp /data]# git log
commit 9f105338768642dd9306f4e0d83897847894176a (HEAD -> master)
Author: zhanghongshun <748749875@qq.com>
Date:   Sun Feb 12 14:55:48 2023 +0800second commitcommit af8a35fd2647b15059297c4d18d18de89f14601b
Author: zhanghongshun <748749875@qq.com>
Date:   Sun Feb 12 14:52:58 2023 +0800first commit

4.创建并切换至新分支

[root@centos7-temp /data]# git checkout -b main
切换到一个新分支 'main'

5.查看当前所处分支

[root@centos7-temp /data]# git branch
* mainmaster

6.在main分支上继续编辑test.txt文件并提交

[root@centos7-temp /data]# vim test.txt [root@centos7-temp /data]# cat test.txt 
11111
22222
33333
[root@centos7-temp /data]# git add test.txt 
[root@centos7-temp /data]# git commit -m "third commit"
[main 14cc0a8] third commit1 file changed, 1 insertion(+)

7.查看提交记录

[root@centos7-temp /data]# git log
commit 14cc0a8bc11ddb183d15241858108da85507d13c (HEAD -> main)
Author: zhanghongshun <748749875@qq.com>
Date:   Sun Feb 12 15:06:10 2023 +0800third commitcommit 9f105338768642dd9306f4e0d83897847894176a (master)
Author: zhanghongshun <748749875@qq.com>
Date:   Sun Feb 12 14:55:48 2023 +0800second commitcommit af8a35fd2647b15059297c4d18d18de89f14601b
Author: zhanghongshun <748749875@qq.com>
Date:   Sun Feb 12 14:52:58 2023 +0800first commit

8.切换到master分支下,然后删除main分支

[root@centos7-temp /data]# git checkout master
切换到分支 'master'[root@centos7-temp /data]# git branch -D main
已删除分支 main(曾为 14cc0a8)。

9.查看所有分支,验证下main分支是否真的被删除了

[root@centos7-temp /data]# git branch
* master

10.查看提交记录

#分支因为没有合并到master分支,就被删除了。所以此时master分支没有main分支上做的新的修改记录

[root@centos7-temp /data]# git log
commit 9f105338768642dd9306f4e0d83897847894176a (HEAD -> master)
Author: zhanghongshun <748749875@qq.com>
Date:   Sun Feb 12 14:55:48 2023 +0800second commitcommit af8a35fd2647b15059297c4d18d18de89f14601b
Author: zhanghongshun <748749875@qq.com>
Date:   Sun Feb 12 14:52:58 2023 +0800first commit

三.恢复main分支

1.查看所有分支的操作记录,对比之前在main分支查看的提交记录

 

 2.根据main的最后一次提交记录来恢复main分支

[root@centos7-temp /data]# git checkout -b main 14cc0a8
切换到一个新分支 'main'[root@centos7-temp /data]# git branch
* mainmaster[root@centos7-temp /data]# git log
commit 14cc0a8bc11ddb183d15241858108da85507d13c (HEAD -> main)
Author: zhanghongshun <748749875@qq.com>
Date:   Sun Feb 12 15:06:10 2023 +0800third commitcommit 9f105338768642dd9306f4e0d83897847894176a (master)
Author: zhanghongshun <748749875@qq.com>
Date:   Sun Feb 12 14:55:48 2023 +0800second commitcommit af8a35fd2647b15059297c4d18d18de89f14601b
Author: zhanghongshun <748749875@qq.com>
Date:   Sun Feb 12 14:52:58 2023 +0800first commit
http://www.yayakq.cn/news/451230/

相关文章:

  • 游戏网站织梦模板北京网站建设项目
  • 三合一网站开发手机网站推荐哪个好
  • 哈尔滨住房和城乡建设厅网站北京网站建设icp有限公司
  • 江苏州 网站制作wordpress无法上传
  • 网络公司 营销型网站网站建设 阿里巴巴旗下
  • 如何做整人网站电子商务网站平台建设前景展望
  • 淄博建设局网站开源博客程序WordPress下载
  • 网站开发团队取什么名字好网站后台的意义
  • 网站视觉规范厦门协会网站建设
  • 网站建设指导方案国家重大建设项目库网站注册
  • 网站怎样绕过360认证wordpress固定链接设置技巧
  • 山南网站制作网站开发设计实训 报告
  • 如何查看一个网站是用什么cms做的网站违规词处罚做网站的
  • 医院电子网站建设企业做一个app多少钱
  • 网站建设论坛做网站的优点
  • 吉林市做网站的科技建设网站说只给前端源码是什么意思
  • 网站支付怎么做安全吗品牌建设怎么做
  • 99设计网站wordpress 内容 插件
  • 网站版权符号代码广东东莞邮政编码
  • 哪个网站可以兼职做效果图河南建设工程信息网官网查询
  • 建设牌官方网站google play谷歌商店
  • vs2008可以做网站金华专业做网站公司
  • 网站制作步骤是什么电子商务网站有哪些内容
  • 外贸网站建设预算wordpress文章编辑旧版
  • 网站备案是给什么进行备案可以放钓鱼网站的免费空间
  • 可以看的网站的浏览器有哪些网站维护的工作内容
  • 联通网站服务器哪里有网站建设工程
  • 网站制作模板wordpress 阿里云镜像
  • eclipse可以做网站嘛wordpress gold
  • 网站的pv是什么什么网站可以做任务挣钱的