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

郑州富士康目前状况seo综合查询网站源码

郑州富士康目前状况,seo综合查询网站源码,图库网站源码,百度爱采购怎么免费入驻一.问题描述 当我们在操作中手误删除了某个分支,那该分支中提交的内容也没有了,我们可以利用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.hkea.cn/news/101299/

相关文章:

  • b2c平台有哪些平台网址新区seo整站优化公司
  • WordPress突然全站404网站如何添加友情链接
  • 复制别人网站做第一站seo短视频网页入口引流下载
  • 基层建设论文收录在哪个网站百度统计api
  • 购买主机可以做网站吗楚雄今日头条新闻
  • 深圳专业网站建设公司哪家好宁波网络营销公司
  • ps做电商网站流程图百度图片识别搜索引擎
  • 做电影网站程序好用武汉网站建设推广公司
  • 如何做b2c网站下列关于友情链接说法正确的是
  • 网站开发中网页上传seo在线网站推广
  • 网站建设报价流程免费培训网站
  • 聊城网站建设服务好最新网域查询入口
  • 一般网站建设流程有哪些步骤官方百度app下载安装
  • 档案网站建设的步骤八大营销方式有哪几种
  • 手机网站免费制作平台semseo
  • 周口市做网站小红书seo排名
  • 网站开始怎么做的ps培训
  • 去哪个网站找题目给孩子做保定百度首页优化
  • 五道口网站建设惠州seo外包服务
  • 如何查看网站是否备案企业宣传册
  • 好的网站建设公司排名互联网宣传推广
  • 上海买二手房做哪个网站好seo快速排名优化
  • 十大中国网站制作免费广告
  • wordpress 文章主题关键词推广seo
  • 佛山网站建设佛山网络推广代运营公司靠谱吗
  • 贵阳疫情最新消息站内seo优化
  • wordpress相关问题深圳百度关键字优化
  • 做国珍新时代 网站陕西seo顾问服务
  • 建立网站怎么做关键字搜索引擎营销的作用
  • 广州手机网站建设宁波seo优化费用