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

网站需要流量世界互联网峰会

网站需要流量,世界互联网峰会,信息化建设办公室网站,上海有名的设计公司有哪些删除⽂件 在 Git 中,删除也是⼀个修改操作,我们实战⼀下, 如果要删除 file5 ⽂件,怎么搞呢?如果你这样做了: 此时,⼯作区和版本库就不⼀致了,要删⽂件,⽬前除了要删⼯作区的⽂件,还要…

删除⽂件

在 Git 中,删除也是⼀个修改操作,我们实战⼀下, 如果要删除 file5 ⽂件,怎么搞呢?如果你这样做了:

此时,⼯作区和版本库就不⼀致了,要删⽂件,⽬前除了要删⼯作区的⽂件,还要清除版本库的⽂件。

root@hcss-ecs-a74f:~# cd gitcode
root@hcss-ecs-a74f:~/gitcode# ls
file1  file2  file3  file4  file5  ReadMe
root@hcss-ecs-a74f:~/gitcode# rm file5
root@hcss-ecs-a74f:~/gitcode# ls
file1  file2  file3  file4  ReadMe
root@hcss-ecs-a74f:~/gitcode# git add file5
root@hcss-ecs-a74f:~/gitcode# git status
On branch master
Changes to be committed:(use "git restore --staged <file>..." to unstage)deleted:    file5

⼀般⾛到这⾥,有两种可能:

• 确实要从版本库中删除该⽂件

• 不⼩⼼删错了

对第⼆种情况,很明显误删,需要使⽤ git 来进⾏恢复,很简单,我们刚学过(删除也是修改):

hyb@139-159-150-152:~/gitcode$ git checkout -- file5
hyb@139-159-150-152:~/gitcode$ ls
file1 file2 file3 file4 file5 ReadMe

对于第⼀种情况,很明显是没有删完,我们只删除了⼯作区的⽂件。这时就需要使⽤ git rm 将⽂件从暂存区和⼯作区中删除,并且 commit :

hyb@139-159-150-152:~/gitcode$ git rm file5
rm 'file5'
hyb@139-159-150-152:~/gitcode$ git status
On branch master
Changes to be committed:(use "git restore --staged <file>..." to unstage)deleted: file5
hyb@139-159-150-152:~/gitcode$ git commit -m"deleted file5"
[master 5476bde] deleted file51 file changed, 0 insertions(+), 0 deletions(-)delete mode 100644 file5
hyb@139-159-150-152:~/gitcode$ git status
On branch master
nothing to commit, working tree clean

现在,⽂件就从版本库中被删除了.

完整过程如下:

root@hcss-ecs-a74f:~# cd gitcode
root@hcss-ecs-a74f:~/gitcode# ls
file1  file2  file3  file4  file5  ReadMe
root@hcss-ecs-a74f:~/gitcode# rm file5
root@hcss-ecs-a74f:~/gitcode# ls
file1  file2  file3  file4  ReadMe
root@hcss-ecs-a74f:~/gitcode# git add file5
root@hcss-ecs-a74f:~/gitcode# git status
On branch master
Changes to be committed:(use "git restore --staged <file>..." to unstage)deleted:    file5root@hcss-ecs-a74f:~/gitcode# git commit -m "delete file5"
[master 33b3d8d] delete file51 file changed, 0 insertions(+), 0 deletions(-)delete mode 100644 file5
root@hcss-ecs-a74f:~/gitcode# git status
On branch master
nothing to commit, working tree clean
root@hcss-ecs-a74f:~/gitcode# git rm file4
rm 'file4'
root@hcss-ecs-a74f:~/gitcode# git status
On branch master
Changes to be committed:(use "git restore --staged <file>..." to unstage)deleted:    file4root@hcss-ecs-a74f:~/gitcode# git commit -m "delete file4"
[master 94cdba6] delete file41 file changed, 0 insertions(+), 0 deletions(-)delete mode 100644 file4
http://www.dtcms.com/a/402742.html

相关文章:

  • 泰安企业建站公司流程网站如何进行优化
  • 搜索优化整站优化包包网站建设
  • 瑞安 网站建设围场网站建设
  • 丰台区的建设网站电子商务网站帮助中心该怎么更好地设计
  • 小型企业网站的设计与实现企业名录搜索
  • 如何做好集团网站建设提供常州网站优化
  • dede可以做视频网站宁波建设监理协会网站
  • 建设购物网站济南网站模板
  • 大连 网站制作 外贸企业网站备案需要什么
  • 我是做化工回收的做哪个网站比较好附近哪里有建设银行
  • 登录网站模板信息手机网站模板下载
  • 合肥花境建设网站库存网站建设定制
  • 单页面网站制作视频盐城专业做网站的公司哪家好
  • 网站404设置网站开发需求分析
  • 清风夏邑进入公众号前端页面优化
  • 河南建设资格执业网站怎么查看网站谁做的
  • 高校网站建设策划无锡哪个网站建设比较好
  • 艺术学院网站建设管理办法景区官方网站建设
  • 专业做鞋子的网站有哪些网站内容管理系统怎么用
  • 十个实用网站网址网站开发前端课程
  • 网站图片处理方案自己做信息网站
  • 那个网站适合学生做兼职青岛即墨区最新事件
  • 电影网站cpa怎么做济南网站的优化
  • 石河子做网站的公司永兴县网站建设哪个好
  • 网站怎么做防360拦截旅游网站建设网站
  • 网站开发的工作wordpress模板位置
  • 网站维护中页面模板wordpress 图片浮动
  • 博达站群网站建设教程wordpress 登录用户名密码
  • 一般做网站要多少钱室内设计学徒有多坑
  • 域名到期换个公司做网站网站建设面对的问题