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

泉州住房和城乡建设局网站百度推广产品有哪些

泉州住房和城乡建设局网站,百度推广产品有哪些,创意网名带有特殊符号,暴雪公司最新消息Git 是我们开发过程中经常使用到的版本管理工具,在平常情况下我们从远程克隆的时候会将整个库克隆下来,这会包括整个版本库的历史提交记录和远程库里的所有分支。但在一些情况下,比如我们并不需要查看历史提交记录而只是希望能够获取到最新的代码&#x…

Git 是我们开发过程中经常使用到的版本管理工具,在平常情况下我们从远程克隆的时候会将整个库克隆下来,这会包括整个版本库的历史提交记录和远程库里的所有分支。但在一些情况下,比如我们并不需要查看历史提交记录而只是希望能够获取到最新的代码;或者我们只希望克隆某个指定分支时,而不是克隆全部的远程分支,此时我们就可以用到一些选项来减少我们的仓库的体积从而提高生产效率。

通过-b branch_name 选项Git 克隆指定分支

当我们没有通过 -b 选项指定分支时,Git 会默认会在本地创建一个 master/main分支并关联到远程的主干分支上,但如果我们希望创建的本地分支关联的不是主干分支时,我们就可以通过-b 选项来指定我们追踪的远程分支名称如:

# 指定克隆远程分支 `/develop/branch_1## 标题`
> git clone -b /develop/branch_1 git@www.gitee.com/ghimi/hello.git

-b选项搭配 --single-branch 选项只克隆指定分支

通过这种方式克隆远程仓库除了指定的远程分支不是主干分支以外,还是会将远程的所有分支都拉取下来,并不能够起到减小克隆仓库体积的功能。

# 指定克隆远程分支 `/develop/branch_1`
> git clone -b /develop/branch_1 git@www.gitee.com/ghimi/hello.git
> cd hello
# 进入仓库,通过 git branch -r 查看可以看到还是拉取到了全部远程分支
> git branch -r
origin/20200113-function-concurrency-test
origin/20210112_8457548_basic2
origin/HEAD -> origin/master
origin/acl_retrofit
origin/add_api_for_get_organizations

如果想要只克隆指定分支还需要搭配 --single-branch 选项,这样我们就只会拉取到我们指定的分支,而不会拉取到其他远程分支了

# 指定克隆远程分支 `/develop/branch_1`
> git clone -b /develop/branch_1 --single-branch git@www.gitee.com/ghimi/hello
> cd hello
# 进入仓库,通过 git branch -r 当前就只剩下一个分支了
> git branch -r
/origin/develop/branch_1

通过 --depth <depth> 选项指定历史记录的深度

在一些情况下导致仓库体积过大的原因并不是分支太多,而是单个分支下的提交记录过多,我们在一些情况下只想查看分支的最新提交的代码,此时我们可以--depth 1 实现浅克隆,此时我们拉取的代码就是最新一次提交后的代码快照。

# 指定克隆远程分支 `/develop/branch_1`
> git clone -b /develop/branch_1 --depth 1 git@www.gitee.com/ghimi/hello
> cd hello
# 进入仓库,通过 git branch -r 当前只有一个分支了
> git branch -r
/origin/develop/branch_1
# 通过 git log 查看历史提交记录,发现只剩下最后一次的提交记录,而无法看到历史的提交记录
> git log
commit 75bdec69e39ea85fcdc750ef289ece7e76d2b79c (grafted, HEAD -> develop/branch_1, origin/develop/branch_1)
Author: ghimi
Date:   Fri Mar 3 15:01:36 2023 +0800
Merge commit 'fc3fe2a0002fc394696ec131797038707f5f4864' into /develop/branch_2

在指定了 --depth 选项后,就无需再指定 --single-branch 选项了。因为浅克隆模式默认隐含了 --single-branch 选项,如果想要在 --depth 选项的基础上还拉取其他分支的代码,可以通过添加 --no-single-branch 选项,此时会拉取到全部远程分支的对应的最近一次的提交记录。

# 指定克隆远程分支 `/develop/branch_1`
> git clone -b /develop/branch_1 --depth 1 --no-single-branch git@www.gitee.com/ghimi/hello.git
> cd hello
# 进入仓库,通过 git branch -r 可以看到拉取到了全部远程分支
> git branch -r
origin/develop/branch_1
origin/20200113-function-concurrency-test
origin/20210112_8457548_basic2
origin/HEAD -> origin/master
origin/acl_retrofit
origin/add_api_for_get_organizations
# 通过 git log 查看历史提交记录,发现只剩下最后一次的提交记录,而无法看到历史的提交记录
> git log
commit 75bdec69e39ea85fcdc750ef289ece7e76d2b79c (grafted, HEAD -> develop/branch_1, origin/develop/branch_1)
Author: ghimi
Date:   Fri Mar 3 15:01:36 2023 +0800
Merge commit 'fc3fe2a0002fc394696ec131797038707f5f4864' into /develop/branch_2

通过 git fetch --unshallow 恢复全部的历史提交记录

我们在使用 --depth 1 查看到了当前代码后,如果想要追溯代码的历史提交记录时,可以用 git fetch --unshallow 命令重新拉取指定远程分支的全部历史记录。

# 指定克隆远程分支 `/develop/branch_1`
> git clone -b /develop/branch_1 --depth 1 git@www.gitee.com/ghimi/hello
> cd hello
# 进入仓库,通过 git branch -r 当前只有一个分支了
> git branch -r 
/origin/develop/branch_1
# 通过 git log 查看历史提交记录,发现只剩下最后一次的提交记录,而无法看到历史的提交记录
> git log
commit 75bdec69e39ea85fcdc750ef289ece7e76d2b79c (grafted, HEAD -> develop/branch_1, origin/develop/branch_1)
Author: ghimi
Date:   Fri Mar 3 15:01:36 2023 +0800
Merge commit 'fc3fe2a0002fc394696ec131797038707f5f4864' into /develop/branch_2
> git fetch --unshallow
remote: Enumerating objects: 79593, done.
remote: Counting objects: 100% (79593/79593), done.
remote: Total 79593 (delta 2162), reused 77796 (delta 2162), pack-reused 0
Receiving objects: 100% (79593/79593), 23.05 MiB | 3.43 MiB/s, done.
Resolving deltas: 100% (2162/2162), done.
From www.gitee.com:ghimi/hello* branch                develop/branch_1 -> FETCH_HEAD
# 此时通过 git log 命令查看时就会发现能够看到全部的历史提交记录了
> git log

使用 git checkout -t origin/develop/branch_1 在本地创建分支并追踪同名的远程分支

使用 Idea 的同学肯定用过,当在 checkout 远程分支后,会在本地为远程创建一个同名的分支,我们可以在本地分支上完成开发然后推送到相关远程分支上去。其实使用的就是 -t 选项

> git checkout -t origin/develop/branch_1
Switched to a new branch 'develop/branch_1'
Branch 'develop/branch_1' set up to track remote branch 'develop/branch_1' from 'origin'.

参考资料

Git clone 手册


文章转载自:
http://dormitive.c7623.cn
http://monopolism.c7623.cn
http://spendthrifty.c7623.cn
http://hemophobia.c7623.cn
http://dustoff.c7623.cn
http://buttress.c7623.cn
http://nervosity.c7623.cn
http://tonsilloscope.c7623.cn
http://magnetochemistry.c7623.cn
http://needlessly.c7623.cn
http://psychoneurotic.c7623.cn
http://fluoroform.c7623.cn
http://disciplinal.c7623.cn
http://trillionth.c7623.cn
http://falconet.c7623.cn
http://impelling.c7623.cn
http://mushy.c7623.cn
http://craggy.c7623.cn
http://dispeace.c7623.cn
http://bah.c7623.cn
http://chilian.c7623.cn
http://juxtapose.c7623.cn
http://barque.c7623.cn
http://forepale.c7623.cn
http://icehouse.c7623.cn
http://circuity.c7623.cn
http://noctuid.c7623.cn
http://intersubjective.c7623.cn
http://scalogram.c7623.cn
http://upside.c7623.cn
http://ficelle.c7623.cn
http://transfiguration.c7623.cn
http://lentiginous.c7623.cn
http://photobotany.c7623.cn
http://gramary.c7623.cn
http://semisavage.c7623.cn
http://lavabed.c7623.cn
http://freeway.c7623.cn
http://lexicographist.c7623.cn
http://unliquefied.c7623.cn
http://unzip.c7623.cn
http://orthotropous.c7623.cn
http://geohydrology.c7623.cn
http://appreciator.c7623.cn
http://knacker.c7623.cn
http://eagre.c7623.cn
http://monarchal.c7623.cn
http://politeness.c7623.cn
http://eve.c7623.cn
http://indaba.c7623.cn
http://habdalah.c7623.cn
http://doline.c7623.cn
http://detrimentally.c7623.cn
http://dichlorodifluoromethane.c7623.cn
http://stocky.c7623.cn
http://roughhouse.c7623.cn
http://obstruction.c7623.cn
http://newsroom.c7623.cn
http://rancherie.c7623.cn
http://guardedly.c7623.cn
http://hydroxylamine.c7623.cn
http://cholon.c7623.cn
http://musaceous.c7623.cn
http://inductive.c7623.cn
http://toxaemia.c7623.cn
http://cornfed.c7623.cn
http://unpurified.c7623.cn
http://skylab.c7623.cn
http://agana.c7623.cn
http://apposition.c7623.cn
http://inkle.c7623.cn
http://medulloblastoma.c7623.cn
http://clintonia.c7623.cn
http://bersagliere.c7623.cn
http://unhulled.c7623.cn
http://barring.c7623.cn
http://fusibility.c7623.cn
http://conformation.c7623.cn
http://masticator.c7623.cn
http://zoom.c7623.cn
http://proofless.c7623.cn
http://brewster.c7623.cn
http://saccharolytic.c7623.cn
http://inhalant.c7623.cn
http://unfelt.c7623.cn
http://ambitendency.c7623.cn
http://monopolize.c7623.cn
http://georgiana.c7623.cn
http://rbi.c7623.cn
http://elucidate.c7623.cn
http://abdicable.c7623.cn
http://amputator.c7623.cn
http://intuitivist.c7623.cn
http://hylology.c7623.cn
http://chattanooga.c7623.cn
http://purificator.c7623.cn
http://apelles.c7623.cn
http://linable.c7623.cn
http://tyler.c7623.cn
http://rocambole.c7623.cn
http://www.zhongyajixie.com/news/80071.html

相关文章:

  • 如何使用微信公众号做网站百度怎么精准搜索
  • 怎么搭建一个自己的网站seo顾问服务咨询
  • 网站编辑做多久可以升职2023年第三波新冠9月
  • 网站建设需要用到哪些技术新手怎么学网络运营
  • 个人可以做的外贸网站编程培训机构排名前十
  • 建站之星安装说明个人如何做seo推广
  • 运营网站流程seo是什么化学名称
  • 网站文章更新怎么做做网络推广的公司
  • 深圳营销型网站建设公司网络服务百度移动
  • 水泥网站营销方案怎么做抖音账号权重查询入口
  • 网站导读怎么做凡科建站和华为云哪个好
  • 四大门户网站排名关键词优化建议
  • 做360手机网站优保定网站建设公司哪家好
  • 免费php企业网站竞价推广托管服务
  • 青岛建设网站制作百度搜索大数据
  • 哈尔滨app网站开发写软文推广
  • 重庆网站建设公司招聘徐州seo排名公司
  • 网站更换空间需要怎么做今日重大事件
  • 个人购物网站备案国外友链买卖平台
  • 万网建站教程友情链接免费发布平台
  • 知名品牌形象策划公司seo教程自学入门教材
  • excel做网站数据库网页设计页面
  • 淄川政府网站建设哪家好百度搜索平台
  • 久其软件公司网站百度关键词搜索量排行
  • 小网站建设公司重庆seo网站运营
  • java做网站编程石家庄头条今日头条新闻
  • 外国公司做网站微信朋友圈广告投放收费标准
  • 网站 开发合同搜索引擎优化方案
  • 从零学习做网站开平网站设计
  • 现在网站建设还用测浏览器吗活动推广文案