Git企业开发控制理论和实操-从入门到深入(六)|多人协作开发

前言

那么这里博主先安利一些干货满满的专栏了!

首先是博主的高质量博客的汇总,这个专栏里面的博客,都是博主最最用心写的一部分,干货满满,希望对大家有帮助。

  • 高质量博客汇总

然后就是博主最近最花时间的一个专栏《Git企业开发控制理论和实操》希望大家多多关注!

  • Git企业开发控制理论和实操

多人协作开发

学习案例一

案例说明

目标:在远端仓库中master分支下的file.txt文件新增两行代码aaabbb
实现:由开发者一新增aaa,由开发者二新增bbb
条件:在一个分支下协作完成。

准备工作

当然我们说过,远端的master分支一定是一个稳定的分支,不能用于开发。所以现在先在远端创建一个dev分支。

在这里插入图片描述
在这里插入图片描述

当然现在本地(云服务器)看不到远端的dev分支,所以先pull一下。

(base) [yufc@ALiCentos7:~/Src/Bit-Courses/GitDevelopment/remote-gitcode]$ git pull 
From gitee.com:Yufch/remote-gitcode* [new branch]      dev        -> origin/dev
Already up-to-date.
(base) [yufc@ALiCentos7:~/Src/Bit-Courses/GitDevelopment/remote-gitcode]$ 

现在本地就有远程的dev分支了。

注意:要区分本地的dev分支和本地所知道的远程的dev分支。

  • 本地的master分支叫做master

  • 远端的master在本地叫做origin/master

  • 远端的dev在本地叫做origin/dev

都是不一样的。

git branch -a # 可以查看本地的所有分支,包括本地的和远端的
(base) [yufc@ALiCentos7:~/Src/Bit-Courses/GitDevelopment/remote-gitcode]$ git branch -a
* masterremotes/origin/HEAD -> origin/masterremotes/origin/devremotes/origin/master
(base) [yufc@ALiCentos7:~/Src/Bit-Courses/GitDevelopment/remote-gitcode]$

然后上面把我的阿里云服务器上的仓库准备好了,我们再准备一个本地(maxOS本地)的一个remote仓库。

(base) [demac@YuMacBook-Air:Git企业开发精品课程]$ git clone https://gitee.com/Yufch/remote-gitcode.git
Cloning into 'remote-gitcode'...
remote: Enumerating objects: 17, done.
remote: Counting objects: 100% (17/17), done.
remote: Compressing objects: 100% (15/15), done.
remote: Total 17 (delta 3), reused 0 (delta 0), pack-reused 0
Receiving objects: 100% (17/17), 4.55 KiB | 4.55 MiB/s, done.
Resolving deltas: 100% (3/3), done.
(base) [demac@YuMacBook-Air:Git企业开发精品课程]$

开始开发

让协作者一完成aaa的更新,协作者二完成bbb的更新。

首先是开发者一:

看一下这行命令。

git checkout -b dev origin/dev

这行命令完成了三件事。

  • 在本地创建了一个dev分支
  • 切到dev分支下
  • 让本地的dev分支和远程的origin/dev分支建立了一个连接

如何查看这个连接呢?

git branch -vv
(base) [yufc@ALiCentos7:~/Src/Bit-Courses/GitDevelopment/remote-gitcode]$ git branch -vv
* dev    7393ea0 [origin/dev] add .gitignoremaster 7393ea0 [origin/master] add .gitignore
(base) [yufc@ALiCentos7:~/Src/Bit-Courses/GitDevelopment/remote-gitcode]$

新增一行aaa

在这里插入图片描述

然后add,commit,push到远程的dev分支中。

(base) [yufc@ALiCentos7:~/Src/Bit-Courses/GitDevelopment/remote-gitcode]$ git add .
(base) [yufc@ALiCentos7:~/Src/Bit-Courses/GitDevelopment/remote-gitcode]$ git commit -m "md file.txt: aaa"
[dev 7c49864] md file.txt: aaa1 file changed, 2 insertions(+), 1 deletion(-)
(base) [yufc@ALiCentos7:~/Src/Bit-Courses/GitDevelopment/remote-gitcode]$ git status
# On branch dev
# Your branch is ahead of 'origin/dev' by 1 commit.
#   (use "git push" to publish your local commits)
#
nothing to commit, working directory clean
(base) [yufc@ALiCentos7:~/Src/Bit-Courses/GitDevelopment/remote-gitcode]$ git push
warning: push.default is unset; its implicit value is changing in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the current behavior after the default changes, use:git config --global push.default matchingTo squelch this message and adopt the new behavior now, use:git config --global push.default simpleSee 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)Counting objects: 5, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 273 bytes | 0 bytes/s, done.
Total 3 (delta 1), reused 0 (delta 0)
remote: Powered by GITEE.COM [GNK-6.4]
To git@gitee.com:Yufch/remote-gitcode.git7393ea0..7c49864  dev -> dev
(base) [yufc@ALiCentos7:~/Src/Bit-Courses/GitDevelopment/remote-gitcode]$

然后是开发者二:

(base) [demac@YuMacBook-Air:remote-gitcode]$ ls
README.en.md    README.md       file.txt
(base) [demac@YuMacBook-Air:remote-gitcode]$ git branch
* master
(base) [demac@YuMacBook-Air:remote-gitcode]$ git checkout -b dev origin/dev
M       file.txt
branch 'dev' set up to track 'origin/dev'.
Switched to a new branch 'dev'
(base) [demac@YuMacBook-Air:remote-gitcode]$ git add .
(base) [demac@YuMacBook-Air:remote-gitcode]$ git commit -m "md file.txt: bbb"
[dev 220f739] md file.txt: bbbCommitter: 🐟的mac <demac@YuMacBook-Air.local>
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly:git config --global user.name "Your Name"git config --global user.email you@example.comAfter doing this, you may fix the identity used for this commit with:git commit --amend --reset-author1 file changed, 2 insertions(+), 1 deletion(-)
(base) [demac@YuMacBook-Air:remote-gitcode]$ git push
To https://gitee.com/Yufch/remote-gitcode.git! [rejected]        dev -> dev (fetch first)
error: failed to push some refs to 'https://gitee.com/Yufch/remote-gitcode.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
(base) [demac@YuMacBook-Air:remote-gitcode]$

我们发现,git拒绝了我们的推送。

这是因为,远程的dev分支下现在是有一行aaa的,而如果我们推送,就会冲突!

所以我们要先使用git pull把远程的东西先拉下来。

在这里插入图片描述

(base) [demac@YuMacBook-Air:remote-gitcode]$ git pull
Auto-merging file.txt
CONFLICT (content): Merge conflict in file.txt
error: could not apply 220f739... md file.txt: bbb
hint: Resolve all conflicts manually, mark them as resolved with
hint: "git add/rm <conflicted_files>", then run "git rebase --continue".
hint: You can instead skip this commit: run "git rebase --skip".
hint: To abort and get back to the state before "git rebase", run "git rebase --abort".
Could not apply 220f739... md file.txt: bbb
(base) [demac@YuMacBook-Air:remote-gitcode]$ git add .
(base) [demac@YuMacBook-Air:remote-gitcode]$ git commit -m "merge"
[detached HEAD a37671a] mergeCommitter: 🐟的mac <demac@YuMacBook-Air.local>
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly:git config --global user.name "Your Name"git config --global user.email you@example.comAfter doing this, you may fix the identity used for this commit with:git commit --amend --reset-author1 file changed, 2 insertions(+), 1 deletion(-)
(base) [demac@YuMacBook-Air:remote-gitcode]$ git push
fatal: You are not currently on a branch.
To push the history leading to the current (detached HEAD)
state now, usegit push origin HEAD:<name-of-remote-branch>(base) [demac@YuMacBook-Air:remote-gitcode]$ git push origin HEAD:dev
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 8 threads
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 292 bytes | 292.00 KiB/s, done.
Total 3 (delta 1), reused 0 (delta 0), pack-reused 0
remote: Powered by GITEE.COM [GNK-6.4]
To https://gitee.com/Yufch/remote-gitcode.git7c49864..a37671a  HEAD -> dev
(base) [demac@YuMacBook-Air:remote-gitcode]$ 

这样就可以了。

在这里插入图片描述

将origin/dev合并到origin/master中

PR方式

现在master分支是没有后面两行代码的。
在这里插入图片描述
要用pull request

在这里插入图片描述

提交PR之后,开发人员要做的事情就已经做完了。

审查人员通过看这个PR单子,文件改动这些信息,可以选择通过PR或拒绝PR。

在这里插入图片描述

本地合并dev再将本地master推送到origin/master上

学习案例二

案例说明

目标:远程master分支下新增funciton1和function2文件

实现:由开发者1新增function1,开发者2新增function2

条件:在不同分支下协作完成(各自私有一个分支)

开始开发

开发者一:

(base) [yufc@ALiCentos7:~/Src/Bit-Courses/GitDevelopment/remote-gitcode]$ git branch -a
* devmasterremotes/origin/HEAD -> origin/masterremotes/origin/devremotes/origin/master
(base) [yufc@ALiCentos7:~/Src/Bit-Courses/GitDevelopment/remote-gitcode]$ git checkout -b feature-1
Switched to a new branch 'feature-1'
(base) [yufc@ALiCentos7:~/Src/Bit-Courses/GitDevelopment/remote-gitcode]$ vim function-1
(base) [yufc@ALiCentos7:~/Src/Bit-Courses/GitDevelopment/remote-gitcode]$ git add .
(base) [yufc@ALiCentos7:~/Src/Bit-Courses/GitDevelopment/remote-gitcode]$ git commit -m "add function-1"
[feature-1 a34d9d6] add function-11 file changed, 2 insertions(+)create mode 100644 function-1
(base) [yufc@ALiCentos7:~/Src/Bit-Courses/GitDevelopment/remote-gitcode]$ git push origin feature-1 
Counting objects: 16, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (11/11), done.
Writing objects: 100% (15/15), 1.93 KiB | 0 bytes/s, done.
Total 15 (delta 4), reused 0 (delta 0)
remote: Powered by GITEE.COM [GNK-6.4]
remote: Create a pull request for 'feature-1' on Gitee by visiting:
remote:     https://gitee.com/Yufch/remote-gitcode/pull/new/Yufch:feature-1...Yufch:master
To git@gitee.com:Yufch/remote-gitcode.git* [new branch]      feature-1 -> feature-1
(base) [yufc@ALiCentos7:~/Src/Bit-Courses/GitDevelopment/remote-gitcode]$

新增了一个function-1文件,然后直接推送到远程,远程就会多一个feature-1分支。

在这里插入图片描述

开发者二:

(base) [demac@YuMacBook-Air:remote-gitcode]$ cat file.txt
hello gitee
hello world
aaa
bbb
(base) [demac@YuMacBook-Air:remote-gitcode]$ ls
README.en.md    README.md       file.txt
(base) [demac@YuMacBook-Air:remote-gitcode]$ git checkout -b feature-2
Switched to a new branch 'feature-2'
(base) [demac@YuMacBook-Air:remote-gitcode]$ touch function-2
(base) [demac@YuMacBook-Air:remote-gitcode]$ vim function-2 
(base) [demac@YuMacBook-Air:remote-gitcode]$ cat function-2 n
I am coding ...
Done!
cat: n: No such file or directory
(base) [demac@YuMacBook-Air:remote-gitcode]$ cat function-2 
I am coding ...
Done!
(base) [demac@YuMacBook-Air:remote-gitcode]$ git add .
(base) [demac@YuMacBook-Air:remote-gitcode]$ git commit -m "add function-2"
[feature-2 2a63bd0] add function-2Committer: 🐟的mac <demac@YuMacBook-Air.local>
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly:git config --global user.name "Your Name"git config --global user.email you@example.comAfter doing this, you may fix the identity used for this commit with:git commit --amend --reset-author1 file changed, 2 insertions(+)create mode 100644 function-2
(base) [demac@YuMacBook-Air:remote-gitcode]$ git push origin feature-2
Enumerating objects: 4, done.
Counting objects: 100% (4/4), done.
Delta compression using up to 8 threads
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 311 bytes | 311.00 KiB/s, done.
Total 3 (delta 1), reused 0 (delta 0), pack-reused 0
remote: Powered by GITEE.COM [GNK-6.4]
remote: Create a pull request for 'feature-2' on Gitee by visiting:
remote:     https://gitee.com/Yufch/remote-gitcode/pull/new/Yufch:feature-2...Yufch:master
To https://gitee.com/Yufch/remote-gitcode.git* [new branch]      feature-2 -> feature-2
(base) [demac@YuMacBook-Air:remote-gitcode]$

在这里插入图片描述

此时目前到这里,我们没有发生任何冲突!

这是因为,他们是私有一个分支的,所以没有冲突。

但天有不测风云,你的小伙伴突然生病了,但需求还没开发完,需要你帮他继续开发,于是他便把feature-2 分支名告诉你了。这时你就需要在自己的机器上切换到 feature-2 分支帮忙继续开发。

这就回到了:多名开发者在一个机器上开发的情况了。

那么对于开发者一来说,我首先需要获得feature-2这个分支。

先pull下来。

(base) [yufc@ALiCentos7:~/Src/Bit-Courses/GitDevelopment/remote-gitcode]$ git pull 
remote: Enumerating objects: 11, done.
remote: Counting objects: 100% (11/11), done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 7 (delta 2), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (7/7), done.
From gitee.com:Yufch/remote-gitcode* [new branch]      feature-2  -> origin/feature-27393ea0..ef7fda4  master     -> origin/master
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for detailsgit pull <remote> <branch>If you wish to set tracking information for this branch you can do so with:git branch --set-upstream-to=origin/<branch> feature-1(base) [yufc@ALiCentos7:~/Src/Bit-Courses/GitDevelopment/remote-gitcode]$ git branch -adev
* feature-1masterremotes/origin/HEAD -> origin/masterremotes/origin/devremotes/origin/feature-1remotes/origin/feature-2remotes/origin/master
(base) [yufc@ALiCentos7:~/Src/Bit-Courses/GitDevelopment/remote-gitcode]$

虽然直接git pull会报错,但是我们看到,确实origin/feature-2分支能被本地看到了。

这是为什么?

git pull

  • 拉取分支内的内容(一定要建立连接后才能使用短的git pull命令)
  • 拉取仓库内容(可以直接拉,不需要分支建立连接,因为和分支本来就没关系)

此时,我们就要在本地创建一个feature-2分支,并和远程的origin/feature-2分支建立联系。·

(base) [yufc@ALiCentos7:~/Src/Bit-Courses/GitDevelopment/remote-gitcode]$ git checkout -b feature-2 origin/feature-2
Branch feature-2 set up to track remote branch feature-2 from origin.
Switched to a new branch 'feature-2'
(base) [yufc@ALiCentos7:~/Src/Bit-Courses/GitDevelopment/remote-gitcode]$ git branchdevfeature-1
* feature-2master
(base) [yufc@ALiCentos7:~/Src/Bit-Courses/GitDevelopment/remote-gitcode]$ 
(base) [yufc@ALiCentos7:~/Src/Bit-Courses/GitDevelopment/remote-gitcode]$ vim function-2 
(base) [yufc@ALiCentos7:~/Src/Bit-Courses/GitDevelopment/remote-gitcode]$ git add .
(base) [yufc@ALiCentos7:~/Src/Bit-Courses/GitDevelopment/remote-gitcode]$ git commit -m "md function2 by 1"
[feature-2 280238d] md function2 by 11 file changed, 2 insertions(+)
(base) [yufc@ALiCentos7:~/Src/Bit-Courses/GitDevelopment/remote-gitcode]$ git push
warning: push.default is unset; its implicit value is changing in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the current behavior after the default changes, use:git config --global push.default matchingTo squelch this message and adopt the new behavior now, use:git config --global push.default simpleSee 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)Counting objects: 5, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 305 bytes | 0 bytes/s, done.
Total 3 (delta 1), reused 0 (delta 0)
remote: Powered by GITEE.COM [GNK-6.4]
To git@gitee.com:Yufch/remote-gitcode.git2a63bd0..280238d  feature-2 -> feature-2! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'git@gitee.com:Yufch/remote-gitcode.git'
hint: Updates were rejected because a pushed branch tip is behind its remote
hint: counterpart. If you did not intend to push that branch, you may want to
hint: specify branches to push or set the 'push.default' configuration variable
hint: to 'simple', 'current' or 'upstream' to push only the current branch.
(base) [yufc@ALiCentos7:~/Src/Bit-Courses/GitDevelopment/remote-gitcode]$

此时远程就有了开发者一为开发者二写的内容了。

当然,如果此时开发者二说自己病好了,那么他想继续开发。

此时的开发者二是看不到开发者一新增的内容了,所以,pull一下即可。

开发者二:

(base) [demac@YuMacBook-Air:remote-gitcode]$ ls
README.en.md    README.md       file.txt        function-2
(base) [demac@YuMacBook-Air:remote-gitcode]$ # 先建立连接
(base) [demac@YuMacBook-Air:remote-gitcode]$ git branch --set-upstream-to=origin/feature-2 feature-2
branch 'feature-2' set up to track 'origin/feature-2'.
(base) [demac@YuMacBook-Air:remote-gitcode]$ git branch -vvdev       220f739 [origin/dev: ahead 1, behind 2] md file.txt: bbb
* feature-2 2a63bd0 [origin/feature-2] add function-2master    ef7fda4 [origin/master] !1 dev请求合并到master Merge pull request !1 from Yufc/dev
(base) [demac@YuMacBook-Air:remote-gitcode]$ git pull
remote: Enumerating objects: 5, done.
remote: Counting objects: 100% (5/5), done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 3 (delta 1), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (3/3), 285 bytes | 95.00 KiB/s, done.
From https://gitee.com/Yufch/remote-gitcode2a63bd0..280238d  feature-2  -> origin/feature-2
Updating 2a63bd0..280238d
Fast-forwardfunction-2 | 2 ++1 file changed, 2 insertions(+)
(base) [demac@YuMacBook-Air:remote-gitcode]$ 

开发好之后push上去就行了。

origin/feature-2和origin/feature-1合并到origin/master上去

这里我们用PR的方式。

在这里插入图片描述

最后把feature-2也提交一份PR。

然后就等审查人员通过PR即可。

在这里插入图片描述

当然,按照之前的建议,我们其实不能像上面那样去合并。

要先让feature-2去合并master,如果有bug,也不会影响master,大家可以参考之前的章节。

解决git branch -a显示已经被删除的远程分支的方法

就是,开发完成之后,远程删除feature-1和feature-2这两个分支了。

但是git branch -a在本地还是能够显示feature-1和feature-2这两个分支,这是不好的。

在这里插入图片描述

git remote show origin

这个命令可以看到远程的一些信息。

(base) [yufc@ALiCentos7:~/Src/Bit-Courses/GitDevelopment/remote-gitcode]$ git remote show origin
* remote originFetch URL: git@gitee.com:Yufch/remote-gitcode.gitPush  URL: git@gitee.com:Yufch/remote-gitcode.gitHEAD branch: masterRemote branches:feature-1               trackedfeature-2               trackedmaster                  trackedrefs/remotes/origin/dev stale (use 'git remote prune' to remove) # 他这里会建议我们去删除这些分支Local branches configured for 'git pull':dev       merges with remote devfeature-2 merges with remote feature-2master    merges with remote masterLocal refs configured for 'git push':feature-1 pushes to feature-1 (up to date)feature-2 pushes to feature-2 (local out of date)master    pushes to master    (local out of date)
(base) [yufc@ALiCentos7:~/Src/Bit-Courses/GitDevelopment/remote-gitcode]$ 
git remote prune origin # 这个命令可以去修剪一些已经被删除的分支
(base) [yufc@ALiCentos7:~/Src/Bit-Courses/GitDevelopment/remote-gitcode]$ git remote prune origin
Pruning origin
URL: git@gitee.com:Yufch/remote-gitcode.git* [pruned] origin/dev
(base) [yufc@ALiCentos7:~/Src/Bit-Courses/GitDevelopment/remote-gitcode]$

这里显示已经帮我们删除了dev分支了。

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

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

相关文章

《机器学习在车险定价中的应用》实验报告

目录 一、实验题目 机器学习在车险定价中的应用 二、实验设置 1. 操作系统&#xff1a; 2. IDE&#xff1a; 3. python&#xff1a; 4. 库&#xff1a; 三、实验内容 实验前的猜想&#xff1a; 四、实验结果 1. 数据预处理及数据划分 独热编码处理结果&#xff08;以…

本地部署 Stable Diffusion(Windows 系统)

相对于使用整合包&#xff0c;手动在 Windows 系统下本地部署 Stable Diffusion Web UI&#xff08;简称 SD-WebUI&#xff09;&#xff0c;更能让人了解一些事情的来龙去脉。 一、安装前置软件&#xff1a;Python 和 Git 1、安装 Python for windows。 下载地址 https://www.p…

数字化、智能化的酒店固定资产管理系统

酒店固定资产管理系统是一种专门为酒店行业定制的管理软件&#xff0c;可以帮助酒店管理者全面、准确地管理固定资产。该系统具有以下实际功能和特点&#xff1a;  资产库存功能&#xff1a;通过扫描二维码或手动输入条形码&#xff0c;完成酒店固定资产的有效总结&#xff0…

浅谈Java中的观察者模式

观察者模式是软件开发中常用的一种设计模式&#xff0c;它通过定义一对多的依赖关系&#xff0c;使得一个对象&#xff08;主题&#xff09;的状态变化可以通知多个其他对象&#xff08;观察者&#xff09;。 这种模式的优点是解耦和增加扩展性&#xff0c;用于实现对象之间的…

pdf.js构建时,报Cannot read property ‘createChildCompiler‘ of undefined #177的解决方法

在本地和CI工具进行构建时&#xff0c;报如下错误。 Cannot read property createChildCompiler of undefined #177解决方法&#xff1a; 找到vue.config.js&#xff0c;在 module.exports {parallel: false, //新增的一行chainWebpack(config) {....config.module.rule(&…

《自动驾驶与机器人中的SLAM技术》之GNSS相关基础知识总结

简介 本篇基于对《自动驾驶与机器人中的SLAM技术》中的GNSS定位相关基础知识进行总结用于备忘 知识点整理 GNSS(全球卫星导航系统)定位原理 GNSS 通过测量自身与地球周围各卫星的距离来确定自身的位置 , 而与卫星的距离主要是通过测量时间间隔来确定的 GNSS与GPS的关系 GPS(…

15. 查看开源项目

15.1 parser.add_argument ① 像运行Tensorboar一样&#xff0c;在Terminal终端&#xff0c;可以命令运行.py文件。 ② 如下图所示&#xff0c;Terminal终端运行.py文件时&#xff0c;--变量 后面的值是给变量进行赋值&#xff0c;赋值后再在.py文件中运行。例如 ./datasets/…

vue2 element 踩坑爬坑

动态增减表单项 这个其实官网有demo&#xff0c;但是自己也调试了好久&#xff0c;记录下&#xff0c;具体写法自己查看文档&#xff1a;https://element.eleme.cn/#/zh-CN/component/form 关键地方在于key&#xff0c;新增数组时&#xff0c;要在数据里增加个key&#xff0c;…

如何在 Kubernetes 中借助Ingress 实现灰度发布和蓝绿发布

前言 部署在 Kubernetes 集群中的应用&#xff0c;在升级发布时可能会存在的问题&#xff1a; 1&#xff0c;由于 Kuberneter 底层 Pod 容器生命周期与网络组件生命周期是异步管理的&#xff0c;在升级时如果没有处理好应用优雅退出的问题&#xff0c;就很容易导致 http 访问请…

FreeSWITCH 1.10.10 简单图形化界面1 - docker/脚本/ISO镜像安装

FreeSWITCH 1.10.10 简单图形化界面1 - docker/脚本/ISO镜像安装 0. 界面预览1. Docker安装1.1 下载docker镜像1.2 启动docker镜像1.3 登录 2. 脚本安装2.1 下载2.2 安装2.3 登录2.4 卸载程序 3. 镜像安装3.1 下载镜像3.2 安装镜像3.3 登录 0. 界面预览 http://myfs.f3322.net…

building and deploying a single-Master RocketMQ cluster

building and deploying a single-Master RocketMQ cluster 1 、下载RocketMQ安装包(这里是通过源码安装)2、安装3、启动nameserver4、启动borkerStart the broker serviceVerify that the broker service is started successfully, for example, the brokers ip is 192.168.1.…

Python爬虫逆向实战案例(五)——YRX竞赛题第五题

题目&#xff1a;抓取全部5页直播间热度&#xff0c;计算前5名直播间热度的加和 地址&#xff1a;https://match.yuanrenxue.cn/match/5 cookie中m值分析 首先打开开发者工具进行抓包分析&#xff0c;从抓到的包来看&#xff0c;参数传递了查询参数m与f&#xff0c;同时页面中…

手机自动无人直播,实景无人直播真的有用吗?

继数字人直播之后&#xff0c;手机自动直播开始火热了起来&#xff0c;因为其门槛低&#xff0c;成本低&#xff0c;一部手机一个账号就可以实现直播&#xff0c;一时深受广大商家的好评。那么&#xff0c;手机自动无人直播究竟是如何实现自动直播的呢&#xff1f; 在传统的直…

什么是数据中心IP,优缺点是什么?

如果根据拥有者或者说发送地址来分类的话&#xff0c;可以将代理分为三类&#xff1a;数据中心ip,住宅ip,移动ip 本文我们来了解数据中心ip的原理以及他们的优势劣势&#xff0c;才能选择适合自己的代理。 一、什么是数据中心ip代理&#xff1f; 数据中心ip是由数据中心拥有…

浏览器输入一个URL之后发生了什么?

URL解析DNS解析TCP连接TSL连接HTTP请求TCP挥手接收并解析响应 URL 解析 主要分为&#xff1a; 协议&#xff0c;eg http,https域名或者ip地址&#xff0c;eg www.baidu.com 域名相对于ip地址来说&#xff0c;更方便人们记忆&#xff0c;但是实际的网络传输中使用的是ip地址 端…

widnows 制作winpe启动盘

下载 官网 大白菜官网,大白菜winpe,大白菜U盘装系统, u盘启动盘制作工具 点击装机版&#xff0c;进行下载&#xff0c;等待下载完成 安装 解压 双击exe运行 插入u盘 识别到的u盘 点击【一键制作成usb启动盘】 点击确定&#xff0c;等待制作完成 重启电脑&#xff0c;选择从…

机器学习深度学习——NLP实战(自然语言推断——微调BERT实现)

&#x1f468;‍&#x1f393;作者简介&#xff1a;一位即将上大四&#xff0c;正专攻机器学习的保研er &#x1f30c;上期文章&#xff1a;机器学习&&深度学习——针对序列级和词元级应用微调BERT &#x1f4da;订阅专栏&#xff1a;机器学习&&深度学习 希望文…

Module not found: Error: Can‘t resolve ‘vue-pdf‘ in ‘xxx‘

使用命令npm run serve时vue项目报错&#xff1a; Module not found: Error: Cant resolve vue-pdf in xxx 解决方案&#xff1a; 运行命令&#xff1a; npm install vue-pdf --save --legacy-peer-deps 即可解决。 再次顺利执行npm run serve

Linux系统USB摄像头测试程序(四)_视频旋转及缩放

下面的程序实现了视频的旋转及缩放&#xff0c;窗口中点击鼠标左键视频向左旋转&#xff0c;点击鼠标右键视频向右旋转并且视频缩小了二分之一。程序中首先把yvyv422转换成了RGB24&#xff0c;然后利用opencv进行了旋转和缩放&#xff0c;其后用sdl2进行了渲染。使用了ffmpeg、…

问道管理:市盈率市净率两个指标含义怎么算?

市盈率和市净率是出资领域常用的两个目标&#xff0c;用于评价公司的估值和出资的报答状况。本文将从多个视点剖析这两个目标的含义和计算方法&#xff0c;帮助读者更好地了解和运用它们。首先&#xff0c;市盈率&#xff08;P/E ratio&#xff09;是用来衡量公司股票价格与每股…