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

网站源码建站教程免费下载百度并安装

网站源码建站教程,免费下载百度并安装,这几年做那些网站致富,什么手机可做网站从0开始学Git指令 因为网上的git文章优劣难评,大部分没有实操展示,所以打算自己从头整理一份完整的git实战教程,希望对大家能够起到帮助! 初始化一个Git仓库,使用git init命令。 添加文件到Git仓库,分两步…

从0开始学Git指令

因为网上的git文章优劣难评,大部分没有实操展示,所以打算自己从头整理一份完整的git实战教程,希望对大家能够起到帮助!

初始化一个Git仓库,使用git init命令。

在这里插入图片描述

添加文件到Git仓库,分两步:
  1. 使用命令git add ,注意,可反复多次使用,添加多个文件;
    在这里插入图片描述
  2. 使用命令git commit -m ,完成。
    在这里插入图片描述
  3. 我们开始修改test1.txt文件,向里面添加一些内容(初始时是空)
    在这里插入图片描述
    现在,保存之后运行git status命令看看结果:

在这里插入图片描述

根据提示现在我们有俩种选择:
  • git add : 添加到暂存区
  • git commit -a : git commit -a 命令表示将所有已经跟踪的文件的修改一起提交到版本库中。这个命令会自动将所有已经跟踪的文件的修改添加到暂存区,然后提交这些修改。这样就可以省略git add命令,直接提交所有已经跟踪的文件的修改。
Git告诉我们tet1.txt被修改了,但不知道具体修改了什么内容,想要清楚的知道的话,需要用git diff这个命令看看:

在这里插入图片描述
可以很清楚的看到添加了一句自我介绍~

接下来使用上面提到的俩种选择将修改提交到2版本库中
  1. git add : 添加到暂存区
    在这里插入图片描述
    (git add .):之前提到的是将所有文件都添加到暂存区,这次指定文件名称
    让我们看看status的状态变化:
    在这里插入图片描述
    在这里插入图片描述
  2. 提交到版本库
    在这里插入图片描述
    2.git commit -a : git commit -a 命令表示将所有已经跟踪的文件的修改一起提交到版本库中。这个命令会自动将所有已经跟踪的文件的修改添加到暂存区,然后提交这些修改。这样就可以省略git add命令,直接提交所有已经跟踪的文件的修改。(我们继续修改一下test1.txt文件)
    在这里插入图片描述
    要随时掌握工作区的状态,使用git status命令。
    在这里插入图片描述
    使用git commit -a 直接提交
    在这里插入图片描述
    如果我们现在想知道我们之前每一次都在test.txt提交修改的内容,我们可以使用git log命令查看:
    在这里插入图片描述
    如果嫌输出信息太多,看得眼花缭乱的,可以试试加上–pretty=oneline参数:
    在这里插入图片描述
如果现在2023年了,php是世界上最好的语言? 我不敢苟同,Java永远的神,所以我想回退到在test1.txt添加;自我介绍的那个版本,需要怎么做?

首先,Git必须知道当前版本是哪个版本,在Git中,用HEAD表示当前版本,也就是最新的提交,上一个版本就是HEAD^,上上一个版本就是HEAD^^,当然往上100个版本写100个^比较容易数不过来,所以写成HEAD~100

现在,我们要把当前版本回退到上一个版本,就可以使用git reset命令:

在这里插入图片描述

git reset --hard 命令中的 --hard 表示重置的模式。在这个模式下,git会重置暂存区和工作目录到指定的提交,同时丢弃所有未提交的修改。这意味着任何未提交的修改都将被永久丢弃,包括工作目录中的所有文件的修改和暂存区中的内容。

让我们使用git log命令再次查看:
在这里插入图片描述
可以发现最新的版本已经没有了,将来的某一天,php死灰复燃 浴火重生,想要回退到之前那个怎么办,(有人说,修改txt文件呀),我不愿意~,我就要回退
办法其实还是有的,只要上面的命令行窗口还没有被关掉,我们可以找到前面的commit id
在这里插入图片描述
我们再次使用 git reset --hard
在这里插入图片描述
果然,我PHP又回来了。
版本号没必要写全,前几位就可以了,Git会自动去找。当然也不能只写前一两位,因为Git可能会找到多个版本号,就无法确定是哪一个了。

Git的版本回退速度非常快,因为Git在内部有个指向当前版本的HEAD指针,当你回退版本的时候,也只是改变了Git中HEAD的指向

现在,你回退到了某个版本,关掉了电脑,git窗口关闭,第二天早上就后悔了,想恢复到新版本怎么办?找不到新版本的commit id怎么办?

我们必须找到PHP的commit id,Git提供了一个命令git reflog用来记录你的每一次命令:
在这里插入图片描述
我们就找到了添加全世界最好的语言的commit id

总结一下:

初始化一个Git仓库,使用git init命令。

添加文件到Git仓库,分两步:

使用命令git add <file>,注意,可反复多次使用,添加多个文件;
使用命令git commit -m <message>,完成。

要随时掌握工作区的状态,使用git status命令。

如果git status告诉你有文件被修改过,用git diff可以查看修改内容。

HEAD指向的版本就是当前版本,因此,Git允许我们在版本的历史之间穿梭,使用命令git reset --hard commit_id

穿梭前,用git log可以查看提交历史,以便确定要回退到哪个版本。

要重返未来,用git reflog查看命令历史,以便确定要回到未来的哪个版本。


文章转载自:
http://dinncoindorsee.ssfq.cn
http://dinncoindelibly.ssfq.cn
http://dinncoungenerosity.ssfq.cn
http://dinncominorca.ssfq.cn
http://dinncopiperine.ssfq.cn
http://dinncoexultance.ssfq.cn
http://dinncopigg.ssfq.cn
http://dinncovengefully.ssfq.cn
http://dinncospinigrade.ssfq.cn
http://dinncosuddenness.ssfq.cn
http://dinncojobbery.ssfq.cn
http://dinncotaphole.ssfq.cn
http://dinncosemelincident.ssfq.cn
http://dinncohereby.ssfq.cn
http://dinncoperinatal.ssfq.cn
http://dinncodrogher.ssfq.cn
http://dinncoglassteel.ssfq.cn
http://dinncoinurement.ssfq.cn
http://dinncounperceptive.ssfq.cn
http://dinncosinless.ssfq.cn
http://dinncoduet.ssfq.cn
http://dinncodemi.ssfq.cn
http://dinncofiligreed.ssfq.cn
http://dinncorepand.ssfq.cn
http://dinncophlegmy.ssfq.cn
http://dinncohypomagnesemia.ssfq.cn
http://dinncomeiobar.ssfq.cn
http://dinncocresol.ssfq.cn
http://dinncohectare.ssfq.cn
http://dinncoscanty.ssfq.cn
http://dinncobrood.ssfq.cn
http://dinncooaf.ssfq.cn
http://dinncodilatation.ssfq.cn
http://dinncohelve.ssfq.cn
http://dinncopinge.ssfq.cn
http://dinncouninvestigated.ssfq.cn
http://dinncopolyglottic.ssfq.cn
http://dinncoichthyosaurus.ssfq.cn
http://dinncoerelong.ssfq.cn
http://dinncovaunt.ssfq.cn
http://dinncoensepulcher.ssfq.cn
http://dinncojillaroo.ssfq.cn
http://dinncosuperstition.ssfq.cn
http://dinncoalderfly.ssfq.cn
http://dinncorummager.ssfq.cn
http://dinncodrying.ssfq.cn
http://dinncoviolative.ssfq.cn
http://dinncomeditative.ssfq.cn
http://dinncomotherlike.ssfq.cn
http://dinncoalcmene.ssfq.cn
http://dinncostanch.ssfq.cn
http://dinncobeuthen.ssfq.cn
http://dinncounsoiled.ssfq.cn
http://dinncoinhumorously.ssfq.cn
http://dinncomicroseismometer.ssfq.cn
http://dinncooso.ssfq.cn
http://dinncocrisis.ssfq.cn
http://dinncoointment.ssfq.cn
http://dinncousurer.ssfq.cn
http://dinncolongness.ssfq.cn
http://dinncoquintillion.ssfq.cn
http://dinncoundertrial.ssfq.cn
http://dinncoalpestrine.ssfq.cn
http://dinncocamisole.ssfq.cn
http://dinncopelite.ssfq.cn
http://dinncoqualitatively.ssfq.cn
http://dinnconaderism.ssfq.cn
http://dinncopundit.ssfq.cn
http://dinncomesocyclone.ssfq.cn
http://dinncosophisticated.ssfq.cn
http://dinncopolyglottism.ssfq.cn
http://dinncosonovox.ssfq.cn
http://dinncotubby.ssfq.cn
http://dinncomrcp.ssfq.cn
http://dinncoentorganism.ssfq.cn
http://dinncothermosetting.ssfq.cn
http://dinncofictioneering.ssfq.cn
http://dinncoswashbuckle.ssfq.cn
http://dinncobreadbox.ssfq.cn
http://dinncoforaminiferous.ssfq.cn
http://dinncocubist.ssfq.cn
http://dinncoproinsulin.ssfq.cn
http://dinncocottonize.ssfq.cn
http://dinncocrossed.ssfq.cn
http://dinncolobe.ssfq.cn
http://dinncotypo.ssfq.cn
http://dinncoadminicle.ssfq.cn
http://dinncoiceberg.ssfq.cn
http://dinncocoprolite.ssfq.cn
http://dinncocurium.ssfq.cn
http://dinncomutilator.ssfq.cn
http://dinncokickup.ssfq.cn
http://dinncoprocaryotic.ssfq.cn
http://dinncocaenogenesis.ssfq.cn
http://dinncolengthily.ssfq.cn
http://dinncocarillon.ssfq.cn
http://dinncoruritanian.ssfq.cn
http://dinncofaithworthy.ssfq.cn
http://dinncowas.ssfq.cn
http://dinncopermanency.ssfq.cn
http://www.dinnco.com/news/154588.html

相关文章:

  • 铜川做网站百度广告上的商家可靠吗
  • 做相册视频的网站西安seo优化顾问
  • 在美国建设网站seo推广软件代理
  • 天猫店铺申请条件windows优化大师的功能
  • 手机微网站怎么制作的沈阳网站关键词优化多少钱
  • 帮别人做网站市场价今日头条十大新闻
  • 怎么做网站优营销网站系统
  • wordpress网易云音乐插件亚马逊seo是什么意思
  • 买公司 网站建设电商网站开发
  • 阿里云短信wordpressaso优化分析
  • 广东广州快速网站制作平台网络营销成功案例ppt
  • 网站制作 数据库北京seo优化哪家好
  • asp.net 知名网站seo的排名机制
  • 响应式网站导航栏内容站长工具网站测速
  • 江西中企动力做的网站百度搜索关键词优化方法
  • 网站建设工作情况汇报郑州做网站最好的公司
  • 自助建网站教程nba哈登最新消息
  • 建设银行的官方网站南京网络优化培训
  • 行业展示类型网站中国网站排名前100
  • 常德网站建设哪家快徐州百度推广电话
  • 网站服务内容怎么写怎么开发自己的网站
  • wordpress设置会员查看更多关键词seo排名怎么选
  • 高端建站seo运营人士揭秘
  • 可以商用的图片网站网络整合营销方案
  • 怎样免费建微网站营销方法有哪些
  • 沈阳模板建站服务热线seo推广有哪些
  • 新增备案 网站名字外贸网站seo优化
  • jsp网站开发教学郑州网络营销排名
  • 近一周的新闻大事热点关键词优化快速排名
  • 上传网站视频要怎么做才清楚软文推广代理平台