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

网络推广优化seo谷歌seo站内优化

网络推广优化seo,谷歌seo站内优化,郑州o2o网站建设汉狮,政府门户网站建设目标首先&#xff0c;我们得了解git reset命令的形式之一&#xff1a; git reset [<mode>] [<commit>] 此命令的作用是恢复HEAD分支到<commit>位置&#xff0c;并根据<mode>决定是否恢复index file和working tree。恢复是指将staging area和working tree…

首先,我们得了解git reset命令的形式之一:

git reset [<mode>] [<commit>]

此命令的作用是恢复HEAD分支到<commit>位置,并根据<mode>决定是否恢复index file和working tree。恢复是指将staging area和working tree的状态还原到commit的状态(如果不指定commit,则默认为last commit)。如果没有pick哪个mode,即omitted mode,则mode默认为–mixed。<commit>可以为commit的hash id或引用值。

此外,mode还有两个值:–soft和–hard。

–soft不会改动(touch) index file和working tree,但是会撤销head到commit之间的all history,这是三个模式所共有的作用。

$ git statusOn branch mainChanges 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:  README.mdno changes added to commit (use "git add" and/or "git commit -a")$ git add README.md$ git statusOn branch mainChanges to be committed:(use "git restore --staged <file>..." to unstage)​    modified:  README.md$ git log --graph --oneline\* 0a071ac (HEAD -> main) A\* 0c888f4 Initial Commit$ git reset --soft 0c888f4$ git statusOn branch mainChanges to be committed:(use "git restore --staged <file>..." to unstage)​    modified:  README.md$ git log --graph --oneline\* 0c888f4 (HEAD -> main) Initial Commit

可以观察到commit A的committed changes都reset为staged changes to be committed。原本已经stage等待commit的changes不会被reset。HEAD指向<commit>,HEAD到<commit>的提交都会被undo。

–mixed在–soft的基础上,进一步reset,它会恢复index到<commit>时的状态。已经在index中的changes会reset回working tree,note that modify working tree≠reset working tree。

$ git reset 0c888f4Unstaged changes after reset:M    README.md

git reset会报告影响到的changes。

–hard会在–mixed的基础上恢复working tree的状态。被跟踪的changes会被丢弃。

Any untracked files or directories in the way of writing any tracked files are simply deleted.

Git文档中的这句话我不是太理解,通过询问ChatGPT,翻译为:任何阻碍跟踪文件的写入的未跟踪文件或目录将被删除。

下面是一个Stack Overflow对该疑问的解释代码例子:

There is a case in which git reset --hard has effects on untracked files.$ touch a.txt$ git add .$ git commit -m'A'$ echo hello >> a.txt$ git add .$ git commit -m'B'$ git rm a.txt$ echo world > a.txt$ git status -sThe status output isD  a.txt?? a.txtThe a.txt in the index is removed and the one in the work tree is untracked.$ cat a.txtworldReset in the mode of --hard,$ git reset --hard$ cat a.txthello$ git statusOn branch masternothing to commit, working tree clean

The untracked a.txt in the work tree is deleted. But we could also say it’s been overwritten with the tracked a.txt in HEAD.

http://www.shuangfujiaoyu.com/news/56990.html

相关文章:

  • 订餐网站开发百度优化怎么做
  • 学网站建设难吗天津seo排名公司
  • 自贡网站建设怎么做
  • 摄影作品网站建设方案书域名网站
  • 做商贸网站seo关键词分析
  • 上海 网站制作公司网站运营方案
  • 门户网站制作的公司网站关键词排名怎么提升
  • 自己电脑做电影网站长尾关键词排名系统
  • 什么网站可以做国外生意百度收录入口提交查询
  • 做网站二级域名随便用吗江苏网络推广公司
  • 中国移动网站建设目前最好的引流推广方法
  • 北京经营性网站备案查询关键词排名方案
  • BC网站开发公司江北seo页面优化公司
  • 广州市安全教育平台武汉seo人才
  • 南做网站站长工具是干嘛的
  • 佛山市专注网站建设平台怎么提升关键词的质量度
  • 自学java 做网站 多久谷歌网站
  • 0基础 网站建设西安网站制作建设
  • 佛山格尔做网站的公司移动网站推广如何优化
  • 苏州商城网站建设电话搜索 引擎优化
  • 我爱我家二手房房源官网天津搜索引擎seo
  • 法治政府建设内容网站公开课企业培训课程视频
  • 网站建设公司愿景平台推广方式有哪些
  • 西安网站建设公司找哪家优化大师安卓版
  • 张掖网站制作聚名网域名
  • mysql网站数据库网络营销课程个人总结
  • h5可以用什么网站做做网站需要什么条件
  • 科技有限公司和商贸有限公司区别淄博seo网站推广
  • 微信小程序源码网站中文搜索引擎网站
  • 宁波网站制作公司费用价格济南网站自然优化