【Git学习笔记】Git分支管理策略及其结构原理分析

【Git学习笔记】Git分支管理策略及其结构原理分析

🔥个人主页大白的编程日记

🔥专栏Git学习笔记


文章目录

  • 【Git学习笔记】Git分支管理策略及其结构原理分析
    • 前言
    • 一.合并冲突
    • 二. 分支管理策略
      • 2.1 分支策略
      • 2.2 bug分支
      • 2.3 删除临时分支
      • 2.4 小结
    • 后言

前言

哈喽,各位小伙伴大家好!今天开始我们就进入新的篇章——Git学习!。今天我们来讲一下Git初始及其结构原理分析。话不多说,我们进入正题!向大厂冲锋
在这里插入图片描述

一.合并冲突

可是,在实际分支合并的时候,并不是想合并就能合并成功的,有时候可能会遇到代码冲突的问题。

b dev1 -步完成创建并切换的动作,示例如下:
为了演示这问题,创建一个新的分支 dev1,并切换至目标分支,我们可以使用 git checkout

qcj@139 - 159 - 150 - 152:~/ gitcodes git checkout
- b dev1
Switched to a new branch 'dev1'
qcje139 - 159 - 150 - 152 : ~/ gitcodes git branch
* dev1
master

在 dev1分支下修改 ReadMe文件,更改文件内容如下,并进行一次提交,如

qcj@139 - 159 - 150 - 152:~/ gitcode$ cat ReadMe
hello bit
hello git
hello world
hello versionl
hello version2
hello version3
write bbb for new branch
# 将 aaa 该为 bbb
qcj@139 - 159 - 150 - 152:~/ gitcode$ git add .
qcj@139 - 159 - 150 - 152:~/ gitcode$ git commit - m"modify ReadMe"
Idev1 0854245]modify ReadMe
1 file changed, l insertion(+), l deletion(-)

切换至 master分支,观察 ReadMe 文件内容:

qcj@139 - 159 - 150 - 152:~/ gitcode$ git checkout master
Switched to branch 'master
qcj@139 - 159 - 150 - 152:~/ gitcode$ cat ReadMe
hello bit
hello git
hello world
hello versionl
hello version2
hello version3
write aaa for new branch

我们发现,切回来之后,文件内容由变成了老的版本,这种现象很正常,我们现在也完全能理解。

此时在 master 分支上,我们对 ReadMe 文件再进行一次修改,并进行提交,如下

qcj@139 - 159 - 150 - 152:~/ gitcode$ git branch
dev1
* master
qcj@139 - 159 - 150 - 152:~/ gitcode$ vim ReadMe
qcj@139 - 159 - 150 - 152:~/ gitcode$
cat ReadMe
hello bit
hello git
hello world
hello version1
hello version2
hello version3
write ccc for new branch
qcje139 - 159 - 150 - 152:~/ gitcode$ git add
qcje139 - 159 - 150 - 152 : ~/ gitcode$ git commit - m"modify ReadMe"
c10f6d0] modify ReadMe
[master
1 file changed,
l insertion(+), 1 deletion(-)

现在, master 分支和 dev1分支各自都分别有新的提交,变成了这样

这种情况下,Git 只能试图把各自的修改合并起来,但这种合并就可能会有冲突,如下所示:

qcj@139 - 159 - 150 - 152:~/ gitcode$ git merge devl
Auto - merging ReadMe
CONFLICT(content) : Merge conflict in ReadMe
Automatic merge failed; fix conflicts and then commit the result
qcj@139 - 159 - 150 - 152:~/ gitcode$ git status
On branch master
You have unmerged paths.
(fix conflicts and run "git commit")
(use "git merge --abort" to abort the merge)
Unmerged paths :
(use "git add <file>.to mark resolution)both modified :
ReadMe
no changes added to commit(use "git add" and /or "git commit -a")

发现 ReadMe 文件有冲突后,可以直接查看文件内容,要说的是 Git 会用 <<<<<<<,二二二二二二,>>>>>>>来标记出不同分支的冲突内容,如下所示:

qcj@139 - 159 - 150 - 152:~/ gitcode$ cat ReadMe
hello bit
hello git
hello world
hello version1
hello version2
hello version3
<<<<<< < HEAD
write ccc for new branch
write bbb for new branch
dev1

此时我们必须要手动调整冲突代码,并需要再次提交修正后的结果!!(再次提交很重要,切勿忘记)

hyb@139-159-150-152:~/gitcode$ cat ReadMe
hello bit
hello git
hello world
hello versionl
hello version2
hello version3
write bbb for new branch
hybe139-159-150-152:~/gitcode$ git add
hyb@139-159-150-152:~/gitcode$ git commit -m"merge ReadMe"
master 2976afc]merge ReadMe

到这里冲突就解决完成,此时的状态变成了

用带参数的 gitlog也可以看到分支的合并情况,具体大家可以自行搜索 git log 的用法:

qcj@139 - 159 - 150 - 152:~/ gitcode$ git log --graph --pretty = oneline --abbrev - commit
* 2976afc(HEAD->master) merge ReadMe
| \
| *c594fd1(dev1) modify ReadMe
* | c10f6d0 modify ReadMe
|/

最后,不要忘记 dev1 分支使用完毕后就可以删除了:

qcj@139 - 159 - 150 - 152:~/ gitcode$ git branch
* master
qcj@139 - 159 - 150 - 152:~/ gitcode$ git branch - d dev1
Deleted branch devl(was c594fd1).

在这里插入图片描述

二. 分支管理策略

通常合并分支时,如果可能,Git 会采用 Fast forward 模式。还记得如果我们采用 Fast forward 模式之后,形成的合并结果是什么呢?回顾一下

在这种 Fast forward 模式下,删除分支后,查看分支历史时,会丢掉分支信息,看不出来最新提交到底是 merge 进来的还是正常提交的。

但在合并冲突部分,我们也看到通过解决冲突问题,会再进行一次新的提交,得到的最终状态为:

那么这就不是 Fast forward 模式了,这样的好处是,从分支历史上就可以看出分支信息。例如我们现在已经删除了在合并冲突部分创建的 dev1 分支,但依旧能看到 master 其实是由其他分支合并得到:

qcj@139 - 159 - 150 - 152:~/ gitcode$ git log --graph --pretty = oneline --abbrev - commit
* 2976afc(HEAD->master) merge ReadMe
| \
| *c594fd1 modify ReadMe
* | c10f6d0 modify ReadMe
|/

Git支持我们强制禁用 Fast forward 模式,那么就会在 merge 时生成一个新的 commit ,这样从分支历史上就可以看出分支信息。

下面我们实战-下 --no-ff方式的 git merge 。首先,创建新的分支 dev2,并切换至新的分支;

qcj@139 - 159 - 150 - 152:~/ gitcode$ git checkout - b dev2
Switched to a new branch 'dev2'

修改 ReadMe 文件,并提交一个新的commit:

qcj@139 - 159 - 150 - 152:~/ gitcode$ cat ReadMe
hello bit
hello git
hello world
hello version1
hello version2
hello version3
write bbb for new branch
a, b, c, d
qcj@139 - 159 - 150 - 152:~/ gitcode$ git add .
qcj@139 - 159 - 150 - 152:~/ gitcode$ git commit - m"modify ReadMe"
[dev2 41b082f] modify ReadMe
1 file changed, 1 insertion(+)

切回master分支,开始合并:

hyb@139 - 159 - 150 - 152:~/ gitcode$ git checkout master
Switched to branch'master'
hybe139 - 159 - 150 - 152 : ~/ gitcode$ git merge --no - ff - m "merge with no-ff" dev2
Merge made by the recursive'strategy.
ReadMe1 +
1 file changed, l insertion(+)
hyba139 - 159 - 150 - 152 : ~/ gitcodes cat ReadMe
hello bit
hello git
hello world
hello versionl
hello version2
hello version3
write bbb for new branch
a, b, c, d

请注意 --no-ff 参数,表示禁用 Fast forward 模式。
禁用 Fast forward 模式后合并会创建-个新的 commit,所以加上-m 参数,把描述写进去。

qcj@139 - 159 - 150 - 152:~/ gitcode$ git log --graph --pretty = oneline --abbrev - commit
* 5bd16b4(HEAD->master) merge with no - ff
| \
| *41b082f(dev2) modify ReadMe
|/

可以看到,不使用 Fast forward 模式,merge后就像这样,

所以在合并分支时,加上–no-ff 参数就可以用普通模式合并,合并后的历史有分支,能看出来曾经做过合并,而 fast forward 合并就看不出来曾经做过合并。

2.1 分支策略

在实际开发中,我们应该按照几个基本原则进行分支管理:

首先,master分支应该是非常稳定的,也就是仅用来发布新版本,平时不能在上面干活;

那在哪干活呢?干活都在dev分支上,也就是说,dev分支是不稳定的,到某个时候,比如1.0版本发布时,再把dev分支合并到master上,在master分支发布1.0版本;

你和你的小伙伴们每个人都在dev分支上干活,每个人都有自己的分支,时不时地往dev分支上合并就可以了。

所以,团队合作的分支看起来就像这样!

2.2 bug分支

假如我们现在正在 dev2 分支上进行开发,开发到一半,突然发现 master分支上面有bug,需要解决。在Git中,每个bug都可以通过一个新的临时分支来修复,修复后,合并分支,然后将临时分支删除。

可现在 dev2 的代码在工作区中开发了一半,还无法提交,怎么办?例如:

qcj@139 - 159 - 150 - 152:~/ gitcode$ git branch
* dev2
master
qcj@139 - 159 - 150 - 152:~/ gitcode$ cat ReadMe
hello bit
hello git
hello world
hello version1
hello version2
hello version3
write bbb for new branch
a, b, c, d
i am coding ...
qcja139 - 159 - 150 - 152:~/ gitcode$ git status
On branch dev2
Changes 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
no changes added to commit(use "git add" and /or "git commit -a")

Git提供了 git stash 命令,可以将当前的工作区信息进行储藏,被储藏的内容可以在将来某个时间恢复出来。

qcj@139 - 159 - 150 - 152:~/ gitcodes git stash
Saved working directory and index state WIP on dev2 : 41b082f modify ReadMe
qcja139 - 159 - 150 - 152 : ~/ gitcodeS git status
On branch dev2
nothing to commit, working tree clean

因此可以放心地创建分用 git status 查看工作区,就是干净的(除非有没有被 Git 管理的文件)支来修复bug。

储藏 dev2 工作区之后,由于我们要基于master分支修复 bug,所以需要切回 master 分支,再新建临时分支来修复 bug,示例如下

qcj@139 - 159 - 150 - 152:~/ gitcode$ git checkout master
Switched to branch 'master'
qcj@139 - 159 - 150 - 152:~/ gitcode$ git checkout - b fix bug
Switched to a new branch 'fix_bug'
qcj@139 - 159 - 150 - 152:~/ gitcode$ vim ReadMe
qcj@139 - 159 - 150 - 152:~/ gitcodes cat ReadMe
hello bit
hello git
hello world
hello versionl
hello version2
hello version3
write bbb for new branch
a, b, c, d, e
qcj@139 - 159 - 150 - 152:~/ gitcode$ git add ReadMe
qcj@139 - 159 - 150 - 152:~/ gitcode$ git commit - m"fix bug'
[fix bug 4bbcoc4] fix bug
1 file changed, 1 insertion(+), 1 deletion(-)

修复完成后,切换到 master分支,并完成合并,最后删除fix_bug 分支

qcj@139 - 159 - 150 - 152:~/ gitcode$ git checkout master
Switched to branch 'master'
qcje139 - 159 - 150 - 152 : ~/ gitcode$ git merge
: --no - ff - m"merge fix_bug branch
fix_bug
Merge made by the 'recursive'strategy.
ReadMe2 + -
1 file changed, l insertion(+), 1 deletion(-)
qcja139 - 159 - 150 - 152 : ~/ gitcodes cat ReadMe
hello bit
hello git
hello world
hello version1
hello version2
hello version3
write bbb for new branch
a, b, c, d, e
qcje139 - 159 - 150 - 152:~/ gitcode$ git branch - d fix_bug
Deleted branch fix bug(was 4bbc0c4).

至此,bug的修复工作已经做完了,我们还要继续回到 dev2 分支进行开发。切换回 dev2 分支:

qcj@139 - 159 - 150 - 152:~/ gitcode$ git checkout dev2
Switched to branch 'dev2
qcj@139 - 159 - 150 - 152:~/ gitcode$ git status
On branch dev2
nothing to commit, working tree clean

工作区是干净的,刚才的工作现场存到哪去了?用 git stash list 命令看看:

qcj@139 - 159 - 150 - 152:~/ gitcodes git stash list
stash@{o}: WIP on dev2 : 41b082f modify ReadM

工作现场还在,Git 把stash 内容存在某个地方了,但是需要恢复一下,如何恢复现场呢?我们可以使用 git stash pop 命令,恢复的同时会把 stash 也删了,示例如下:

qcj@139 - 159 - 150 - 152:~/ gitcode$ git stash pop
On branch dev2
Changes not staged for commit :(use "git add <file>..." to update what will be committed)." to discard changes in working directory)(use "git restore <file>...modified:
ReadMe
no changes added to commit(use "git add" and /or "git commit -a")
Dropped refs / stashe{ 0 }(4f873250b3503687b5efd26196776aee7e3724c2)

再次查看的时候,我们已经发现已经没有现场可以恢复了

hyb@139-159-150-152:~/gitcode$ git stash list
hyb@139-159-150-152:~/gitcode$

另外,恢复现场也可以采用 git stash apply 恢复,但是恢复后,stash内容并不删除,你需要用git stash drop 来删除;

你可以多次stash,恢复的时候,先用git stash list 查看,
然后恢复指定的stash,用命令git stash apply stash@{o},这部分请同学们自行使用。

恢复完代码之后我们便可以继续完成开发,开发完成后便可以进行提交,例如:

qcj@139 - 159 - 150 - 152:~/ gitcode$ cat ReadMe
hello bit
hello git
hello world
hello version1
hello version2
hello version3
write bbb for new branch
a, b, c, d
i am coding ...
Done!
qcj@139 - 159 - 150 - 152:~/ gitcode$ git add .
qcj@139 - 159 - 150 - 152:~/ gitcode$ git commit - m"modify ReadMe"
[dev2 ed0916d] modify ReadMe
1 file changed, 1 insertion(+)

但我们注意到了,修复 bug的内容,并没有在 dev2上显示。此时的状态图为:

Master 分支目前最新的提交,是要领先于新建 dev2 时基于的 master 分支的提交的,所以我们在 dev2 中当然看不见修复 bug 的相关代码。

我们的最终目的是要让 master 合并 dev2 分支的,那么正常情况下我们切回 master 分支直接合并即可,但这样其实是有一定风险的。

是因为在合并分支时可能会有冲突,而代码冲突需要我们手动解决(在 master 上解决)。我们无法保证对于冲突问题可以正确地一次性解决掉,因为在实际的项目中,代码冲突不只一两行那么简单,有可能几十上百行,甚至更多,解决的过程中难免手误出错,导致错误的代码被合并到 master 上。此时的状态为:

解决这个问题的·个好的建议就是:最好在自己的分支上合并下master,再让master去合并dev ,这样做的目的是有冲突可以在本地分支解决并进行测试,而不影响 master 。此时的状态为:

对应的实操演示如下,要说明的是,以下演示的merge操作,没有使用–no-ff,但上述的图示是禁用 Fast forward 了模式后得出的,主要是为了方便解释问题。

# dev合并master--no - ff,但上述的图⽰是
qcj@139 - 159 - 150 - 152:~/ gitcode$ git branch
* dev2
master
qcj@139 - 159 - 150 - 152:~/ gitcode$ git merge master
Auto - merging ReadMe
CONFLICT(content) : Merge conflict in ReadMe
Automatic merge failed; fix conflicts and then commit the result.
#发⽣冲突
qcj@139 - 159 - 150 - 152:~/ gitcode$ cat ReadMe
hello bit
hello git
hello world
hello version1
hello version2
hello version3
write bbb for new branch
<<<<<<< HEAD
a, b, c, d
i am coding ... Done!
====== =
a, b, c, d, e
>>>>>> > master
qcj@139 - 159 - 150 - 152:~/ gitcode$ vim ReadMe
qcj@139 - 159 - 150 - 152:~/ gitcode$ cat ReadMe
hello bit
hello git
hello world
hello version1
hello version2
hello version3
write bbb for new branch
a, b, c, d, e
i am coding ... Done!
qcj@139 - 159 - 150 - 152:~/ gitcode$ git add .
qcj@139 - 159 - 150 - 152:~/ gitcode$ git commit - m"merge master"
[dev2 447d29f] merge master
qcj@139 - 159 - 150 - 152:~/ gitcode$ git status
On branch dev2
nothing to commit, working tree clean
qcj@139 - 159 - 150 - 152:~/ gitcode$ git checkout master
Switched to branch 'master'
qcj@139 - 159 - 150 - 152:~/ gitcode$ git merge dev2
Updating 193421f..447d29f
Fast - forward
ReadMe | 1 +
1 file changed, 1 insertion(+)
qcj@139 - 159 - 150 - 152:~/ gitcode$ git status
On branch master
nothing to commit, working tree clean
qcj@139 - 159 - 150 - 152:~/ gitcode$ git branch - d dev2
Deleted branch dev2(was 447d29f).


2.3 删除临时分支

软件开发中,总有无穷无尽的新的功能要不断添加进来。

添加一个新功能时,你肯定不希望因为一些实验性质的代码,把主分支搞乱了,所以,每添加一个新功能,最好新建一个分支,我们可以将其称之为 feature 分支,在上面开发,完成后,合并,最后,删除该 feature 分支。

可是,如果我们今天正在某个 feature 分支上开发了一半,被产品经理突然叫停,说是要停止新功能的开发。虽然白干了,但是这个 feature 分支还是必须就地销毁,留着无用了。这时使用传统的 git branch -d 命令删除分支的方法是不行的。演示如下:

qcj@139 - 159 - 150 - 152:~/ gitcode$ git checkout - b dev3
Switched to a new branch 'dev3'
qcj@139 - 159 - 150 - 152:~/ gitcode$ vim ReadMe
qcj@139 - 159 - 150 - 152:~/ gitcode$ cat ReadMe
hello bit
hello git
hello world
hello version1
hello version2
hello version3
write bbb for new branch
a, b, c, d, e
i am coding ... Done!
i am writing new features ...
qcj@139 - 159 - 150 - 152:~/ gitcode$ git add .
qcj@139 - 159 - 150 - 152:~/ gitcode$ git commit - m"modify ReadMe for new features"
[dev3 cd2f149] modify ReadMe for new features
1 file changed, 1 insertion(+)
qcj@139 - 159 - 150 - 152:~/ gitcode$ git checkout master
Switched to branch 'master'
qcj@139 - 159 - 150 - 152:~/ gitcode$ git branch - d dev3
error : The branch 'dev3' is not fully merged.
If you are sure you want to delete it, run 'git branch -D dev3'.

直接使用传统的删除分支的方法不行,按照提示,有了如下方式:

qcj@139 - 159 - 150 - 152:~/ gitcode$ git branch - D dev3
Deleted branch dev3(was cd2f149).
qcj@139 - 159 - 150 - 152:~/ gitcode$ git branch
* master

2.4 小结

  • 分支在实际中有什么用呢?假设你准备开发一个新功能,但是需要两周才能完成,第一周你写了50%的代码,如果立刻提交,由于代码还没写完,不完整的代码库会导致别人不能干活了。如果等代码全部写完再一次提交,又存在丢失每天进度的巨大风险。
  • 现在有了分支,就不用怕了。你创建了一个属于你自己的分支,别人看不到,还继续在原来的分支上正常工作,而你在自己的分支上干活,想提交就提交,直到开发完毕后,再一次性合并到原来的分支上,这样,既安全,又不影响别人工作。
  • 并且 Git 无论创建、切换和删除分支,Git在1秒钟之内就能完成!无论你的版本库是1个文件还是1万个文件。

后言

这就是Git初始及其结构原理分析。大家自己好好消化!今天就分享到这!感谢各位的耐心垂阅!咱们下期见!拜拜~

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.rhkb.cn/news/35785.html

如若内容造成侵权/违法违规/事实不符,请联系长河编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

STAR Decomposition 一种针对极端事件的信号分解方法 论文精读加复现

STAR 分解&#x1f680; 在时序预测任务中&#xff0c;为了情绪化信号的各种成分&#xff0c;例如趋势信息季节信息等往往都需要对信号进行分解。目前熟知的分解方式有很多种&#xff0c;经验模态分解 EMD 变分模态分解 VMD &#xff0c;还有 集合经验模态分解 EEMD&#xff0c…

大一新生备战蓝桥杯c/c++B组——2024年省赛真题解题+心得分享

一&#xff0c;握手问题 这个题用点像小学奥数&#xff0c;直接手算就行 答案&#xff1a;1204 二&#xff0c;小球反弹 这个题思路简单&#xff0c;但是运行会显示超时。在思考思考&#xff0c;后续补代码。 三&#xff0c;好数 思路一&#xff1a; #include <iostream&…

【最新版】智慧小区物业管理小程序源码+uniapp全开源

一.系统介绍 智慧小区物业管理小程序,包含小区物业缴费、房产管理、在线报修、业主活动报名、在线商城等功能。为物业量身打造的智慧小区运营管理系统,贴合物业工作场景,轻松提高物业费用收缴率,更有功能模块个性化组合,助力物业节约成本高效运营。 二.搭建环境 系统环…

OLE注册是什么?

在Windows操作系统的生态中&#xff0c;‌OLE&#xff08;Object Linking and Embedding&#xff0c;对象链接与嵌入&#xff09;‌ 是一项核心技术&#xff0c;它使得不同应用程序之间能够共享数据和功能。例如&#xff0c;用户可以在Word文档中嵌入一个Excel表格&#xff0c;…

深入理解Linux文件系统:从磁盘结构到inode与挂载

博客总结 核心内容 磁盘物理结构 机械硬盘&#xff08;HDD&#xff09;与固态硬盘&#xff08;SSD&#xff09;的区别&#xff0c;磁盘的组成&#xff08;盘片、磁头、磁道、扇区&#xff09;及工作原理&#xff08;磁头悬浮、高速旋转&#xff09;。 企业级磁盘与桌面级磁盘的…

Spring Data JPA 参数陷阱:从 500 错误到完美解决的奇妙之旅 ✨

&#x1f680; Spring Data JPA 参数陷阱&#xff1a;从 500 错误到完美解决的奇妙之旅 &#x1f31f; 嘿&#xff0c;各位技术冒险家&#xff01;&#x1f44b; 今天我要带你们走进一场 Spring Data JPA 的“参数迷雾”救援行动——从一个让人抓狂的 500 错误&#xff0c;到最…

YOLO obb全流程

内容&#xff1a;xanylabeling 数据标注工具&#xff1b;pytorch&#xff08;python&#xff09;&#xff1b;yolo-obb 模型 一、数据集 1、数据集工具xanylabeling的安装 &#xff08;详细配置与使用方法参考&#xff1a;X-Anylabeling自动标注软件安装使用教程含conda环境…

基于大语言模型与知识图谱的智能论文生成工具开发构想

基于大语言模型与知识图谱的智能论文生成工具开发构想 一、研究背景与意义 1.1 学术写作现状分析 #mermaid-svg-FNVHG5EiEgVSCpHK {font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}#mermaid-svg-FNVHG5EiEgVSCpHK .error-icon{fil…

学c++的人可以几天速通python?

学了俩天啊&#xff0c;文章写纸上了 还是蛮有趣的

【计算机网络】一二章

一 二 非常棒的例子 相同的传播时延&#xff0c;带宽越大&#xff0c;该链路上所能容纳的比特数越多 相同的传播时延&#xff0c;带宽越大&#xff0c;该链路上所能容纳的比特数越多 往返时间&#xff08;Round-Trip Time&#xff0c;RTT&#xff09;s是指从发送端发送数据分组…

使用Flask和OpenCV 实现树莓派与客户端的视频流传输与显示

使用 Python 和 OpenCV 实现树莓派与客户端的视频流传输与显示 在计算机视觉和物联网领域&#xff0c;经常需要将树莓派作为视频流服务器&#xff0c;通过网络将摄像头画面传输到客户端进行处理和显示。本文将详细介绍如何利用picamera2库、Flask 框架以及 OpenCV 库&#xff…

Kafka跨集群数据备份与同步:MirrorMaker运用

#作者&#xff1a;张桐瑞 文章目录 前言MirrorMaker是什么运行MirrorMaker各个参数的含义 前言 在大多数情况下&#xff0c;我们会部署一套Kafka集群来支撑业务需求。但在某些特定场景下&#xff0c;可能需要同时运行多个Kafka集群。比如&#xff0c;为了实现灾难恢复&#x…

ECharts仪表盘-仪表盘12,附视频讲解与代码下载

引言&#xff1a; ECharts仪表盘&#xff08;Gauge Chart&#xff09;是一种类似于速度表的数据可视化图表类型&#xff0c;用于展示单个或多个变量的指标和状态&#xff0c;特别适用于展示指标的实时变化和状态。本文将详细介绍如何使用ECharts库实现一个仪表盘&#xff0c;…

Harmony OS【 Tabs 导航篇】

设计图&#xff1a; 代码层&#xff1a; Entry Component struct Index {build() {Tabs({ barPosition: BarPosition.End }) {}.scrollable(false).vertical(false).divider({strokeWidth: 0.5,color: #0d182431}).backgroundColor(#F1f3f5).padding({ top: 36, bottom: 28 }…

兆芯大道云行 | 破解高性能云计算数据存储瓶颈

随着数字化转型的加速和数据安全战略的提升&#xff0c;以及国家政策的驱动&#xff0c;政府、金融、能源等关键领域对数据存储的自主可控要求不断提高&#xff0c;传统依赖国外芯片和技术的集中式存储架构面临安全与扩展性瓶颈。例如&#xff0c;政务云场景中原有的非信创服务…

RSI 量化策略实战指南:基于 iTick 报价源的 Python 实现

一、策略原理 相对强弱指标&#xff08;Relative Strength Index, RSI&#xff09;是由 Welles Wilder 提出的经典技术指标&#xff0c;通过计算价格波动的幅度衡量市场超买 / 超卖状态。RSI 取值范围 0-100&#xff0c;常用判断标准&#xff1a; RSI > 70&#xff1a;超买…

12 File文件对象:创建、获取基本信息、遍历文件夹、查找文件;字符集的编解码 (黑马Java视频笔记)

文章目录 File >> 存储数据的方案1. 认识File2. File操作2.1 创建File对象2.2 File操作1&#xff09;对文件对象的信息的操作2&#xff09;文件/文件夹的创建/删除3&#xff09;⭐⭐对文件夹的遍历 3. 方法递归3.1 认识递归3.2 递归算法及其执行流程1) 案例&#xff1a;2…

逻辑派G1 6层高速板学习

逻辑派G1 6层高速板学习 一、原理图分析二、电源分析三、网表导入四、板框导入五、PCB快捷键导入与设置六、模块抓取以及接口器件布局七、模块化布局--预布局&#xff08;先放各模块中的大器件&#xff09;1 HDMI模块布局2 MCU模块布局3 FPGA模块布局4 DDR3模块布局5 DCDC电源模…

图论——广度优先搜索实现

99. 岛屿数量 题目描述 给定一个由 1(陆地)和 0(水)组成的矩阵,你需要计算岛屿的数量。岛屿由水平方向或垂直方向上相邻的陆地连接而成,并且四周都是水域。你可以假设矩阵外均被水包围。 输入描述 第一行包含两个整数 N, M,表示矩阵的行数和列数。 后续 N 行,每行…

PTS-G1K13M RF Generator 1kW / 13MHz User’s Manual 手侧

PTS-G1K13M RF Generator 1kW / 13MHz User’s Manual 手侧