05.git团队协作

05.git团队协作

一.团队内协作

image-20210908204402843

二.跨团队协作

image-20210908204430133

三.GitHub操作

GitHub 网址:https://github.com/
Ps:全球最大同性交友网站,技术宅男的天堂,新世界的大门,你还在等什么?
账号 姓名 验证邮箱
atguiguyueyue 岳不群 atguiguyueyue@aliyun.com
atguigulinghuchong 令狐冲 atguigulinghuchong@163.com
atguigudongfang1 东方不败 atguigudongfang@163.com
注:此三个账号为讲师使用账号,同学请自行注册,然后三个同学为一组进行团队协作!

3.1 新建远程仓库

image-20210908204849198
image-20210908204911894

3.2 远程仓库操作

命令名称 作用
git remote -v 查看当前所有远程地址别名
git remote add 别名 远程地址 起别名
git remote rm 别名 git删除远程地址
git push 别名 分支 推送本地分支上的内容到远程仓库
git clone 远程地址 将远程仓库的内容克隆到本地
git pull 远程库地址别名 远程分支名 将远程仓库对于分支最新内容拉下来后与当前本地分支直接合并

3.2.1 创建远程仓库别名

3.2.1.1 基本语法

git remote -v 查看当前所有远程地址别名
git remote add 别名 远程地址

3.2.1.2 实操
Jason@JASON MINGW64 ~/Desktop/GitTest (master)
$ git remote -v

Jason@JASON MINGW64 ~/Desktop/GitTest (master)
$ git remote add git-demo https://github.com/Jason-Vue/git-demo.git

Jason@JASON MINGW64 ~/Desktop/GitTest (master)
$ git remote -v
git-demo        https://github.com/Jason-Vue/git-demo.git (fetch)
git-demo        https://github.com/Jason-Vue/git-demo.git (push)

Jason@JASON MINGW64 ~/Desktop/GitTest (master)
image-20210908210707535

3.2.2 推送本地分支到远程仓库

3.2.2.1 基本语法

git push 别名 分支

3.2.3 ==新版本的GitHub远程推送新方式(需要token)==

image-20210908213857406

原因:自2021年8月13日起,github不再支持使用密码push的方式

3.2.3.1 使用Personal access token

首先,需要获取token

  1. 点击你的GitHub头像 -> 设置 -> 开发者设置 -> Personal access tokens -> Generate new token
  2. 生成token
img

3.复制token

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

img

4.使用token进行push、pull、clone等操作(pull和clone等操作原理同push,只需替换push为pull或其他相应的命令即可)
使用token的方式其实原理在于将原来明文密码换为token,说白了就是token>=password,之所以我这里写了>号,是因为token的功能远大于原来的password,相比password,token具有很多其没有的用法。
我将使用token的方法进行了细分,以满足不同的使用要求。请各位根据自己的使用情况进行选择

==token法一:直接push==

此方法每次push都需要输一遍token,很是费劲啊

# git push https://你的token@你的仓库链接,我这里是我的仓库链接你要改成你的
git push https://你的token@github.com/sober-orange/study.git
img
==token法二:修改remote别名==

这种方式在push的时候直接指明别名就可
如果你已经设置过remote别名,使用如下命令

# 我这里的别名是origin
# git remote set-url 你的remote别名 https://你的token@你的仓库地址
git remote set-url origin https://你的token@github.com/sober-orange/study.git
# 提交代码
git push -u origin master

如果你未设置过别名,使用如下命令添加别名

# git remote add 别名 https://你的token@你的仓库地址
git remote add origin https://你的token@github.com/sober-orange/study.git
# 提交代码
git push -u origin master
==token法三:使用Git Credential Manager Core (GCM Core) 记住token==
git push
Username: 你的用户名
Password: 你的token
# 记住token
git config credential.helper store
==toekn法四:使用Windows的凭据管理器==
  1. 打开凭据管理器 -> windows凭据
  2. 找到“git:https://github.com”的条目,编辑它
  3. 用token替换你以前的密码


    img
3.2.3 token实操
Jason@JASON MINGW64 ~/Desktop/GitTest (master)
$ git remote add git-test01 https://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@github.com/Jason-Vue/git-demo.git

Jason@JASON MINGW64 ~/Desktop/GitTest (master)
$ git remote -v
git-demo        https://github.com/Jason-Vue/git-demo.git (fetch)
git-demo        https://github.com/Jason-Vue/git-demo.git (push)
git-test        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@https://github.com/Jason-Vue/git-demo.git (fetch)
git-test        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@https://github.com/Jason-Vue/git-demo.git (push)
git-test01      https://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@github.com/Jason-Vue/git-demo.git (fetch)
git-test01      https://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@github.com/Jason-Vue/git-demo.git (push)

Jason@JASON MINGW64 ~/Desktop/GitTest (master)
$ git push git-test01 master
fatal: unable to access 'https://github.com/Jason-Vue/git-demo.git/': OpenSSL SSL_read: Connection was reset, errno 10054

Jason@JASON MINGW64 ~/Desktop/GitTest (master)
$ git push git-test01 master
Enumerating objects: 21, done.
Counting objects: 100% (21/21), done.
Delta compression using up to 4 threads
Compressing objects: 100% (14/14), done.
Writing objects: 100% (21/21), 1.72 KiB | 160.00 KiB/s, done.
Total 21 (delta 6), reused 0 (delta 0)
remote: Resolving deltas: 100% (6/6), done.
To https://github.com/Jason-Vue/git-demo.git
 * [new branch]      master -> master
image-20210909091217219

3.2.4 Git删除网络远程地址

git remote rm 别名

Jason@JASON MINGW64 ~/Desktop/GitTest (master)
$ git remote -v
git-demo        https://github.com/Jason-Vue/git-demo.git (fetch)
git-demo        https://github.com/Jason-Vue/git-demo.git (push)
git-test        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@https://github.com/Jason-Vue/git-demo.git (fetch)
git-test        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@https://github.com/Jason-Vue/git-demo.git (push)
git-test01      https://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@github.com/Jason-Vue/git-demo.git (fetch)
git-test01      https://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@github.com/Jason-Vue/git-demo.git (push)

Jason@JASON MINGW64 ~/Desktop/GitTest (master)
$ git remote rm git-demo

Jason@JASON MINGW64 ~/Desktop/GitTest (master)
$ git remote -v
git-test        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@https://github.com/Jason-Vue/git-demo.git (fetch)
git-test        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@https://github.com/Jason-Vue/git-demo.git (push)
git-test01      https://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@github.com/Jason-Vue/git-demo.git (fetch)
git-test01      https://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@github.com/Jason-Vue/git-demo.git (push)

Jason@JASON MINGW64 ~/Desktop/GitTest (master)
$ git remote rm git-test

Jason@JASON MINGW64 ~/Desktop/GitTest (master)
$ git remote -v
git-test01      https://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@github.com/Jason-Vue/git-demo.git (fetch)
git-test01      https://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@github.com/Jason-Vue/git-demo.git (push)
image-20210909092529515

3.2.5 拉取远程库的内容

3.2.5.1 基本语法

git pull 远程库地址别名 分支

3.2.5.2 实操
Jason@JASON MINGW64 ~/Desktop/GitTest (master)
$ git pull git-test01 master
remote: Enumerating objects: 8, done.
remote: Counting objects: 100% (8/8), done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 6 (delta 2), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (6/6), done.
From https://github.com/Jason-Vue/git-demo
 * branch            master     -> FETCH_HEAD
   379cbbf..7d1ed0a  master     -> git-test01/master
Updating 379cbbf..7d1ed0a
Fast-forward
 hello.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Jason@JASON MINGW64 ~/Desktop/GitTest (master)
$ cat hello.txt
hello world!hello Git!
hello world!hello Git!
hello world!hello Git!
hello world!hello Git!
hello world!hello Git!
hello world!hello Git! master分支
hello world!hello Git!
hello world!hello Git!   hot-fix分支合并
我是岳不群在线更改的代码!!!
image-20210909093659837
image-20210909094123701

3.2.6 克隆远程仓库到本地仓库

3.2.6.1 基本语法

git clone 远程地址

3.2.6.2 实际操作
Jason@JASON MINGW64 ~/Desktop/git-lhc
$ git clone https://github.com/Jason-Vue/git-demo.git
Cloning into 'git-demo'...
remote: Enumerating objects: 27, done.
remote: Counting objects: 100% (27/27), done.
remote: Compressing objects: 100% (12/12), done.
remote: Total 27 (delta 8), reused 20 (delta 6), pack-reused 0
Unpacking objects: 100% (27/27), done.

Jason@JASON MINGW64 ~/Desktop/git-lhc
$ cd git-demo

Jason@JASON MINGW64 ~/Desktop/git-lhc/git-demo (master)
$ ll
total 1
-rw-r--r-- 1 Jason 197121 265  9月  9 09:45 hello.txt

Jason@JASON MINGW64 ~/Desktop/git-lhc/git-demo (master)
$ cat hello.txt
hello world!hello Git!
hello world!hello Git!
hello world!hello Git!
hello world!hello Git!
hello world!hello Git!
hello world!hello Git! master分支
hello world!hello Git!
hello world!hello Git!   hot-fix分支合并
我是岳不群在线更改的代码!!!

Jason@JASON MINGW64 ~/Desktop/git-lhc/git-demo (master)
$ ls
hello.txt

Jason@JASON MINGW64 ~/Desktop/git-lhc/git-demo (master)
image-20210909095120240
image-20210909095146112

小结:clone 会做如下操作:

1、拉取代码。

2、初始化本地仓库。

3、创建别名

3.3 ==团队内协作==

3.3.1 选择邀请合作者

image-20210909101037044

3.3.2 填入想要合作的人

image-20210909101019437

3.3.3 复 制 地 址 并 通 过 微 信 钉 钉 等 方 式 发 送 给 该 用 户 , 复 制 内 容 如 下 :

https://github.com/atguiguyueyue/git-shTest/invitations

image-20210909100952604

3.3.4 在atguigulinghuchong 这个账号中的地址 栏 复制 收到邀请的链接 ,点击接受邀请。

image-20210909100926426

3.3.5 在成功之后可以在 atguigulinghuchong 这个账号上看到 git-Test的远程仓库

image-20210909100902546

3.3.6 并令狐冲可以修改内容并 push

--编辑 clone 下来的文件
Layne@LAPTOP-Layne  MINGW64  /d/Git-Space/pro-linghuchong/git-shTest
(master)
$ vim hello.txt
Layne@LAPTOP-Layne  MINGW64  /d/Git-Space/pro-linghuchong/git-shTest
(master)
$ cat hello.txt
hello git! hello atguigu!  2222222222222
hello git! hello atguigu! 33333333333333
hello git! hello atguigu!
hello git! hello atguigu!
hello git! hello atguigu! 我是最帅的,比岳不群还帅
hello git! hello atguigu!
hello git! hello atguigu!
hello git! hello atguigu!
hello git! hello atguigu!
hello git! hello atguigu!
hello git! hello atguigu!
hello git! hello atguigu!
hello git! hello atguigu!
hello git! hello atguigu!
hello git! hello atguigu! master test
hello git! hello atguigu! hot-fix test
--将编辑好的文件添加到暂存区
Layne@LAPTOP-Layne  MINGW64  /d/Git-Space/pro-linghuchong/git-shTest
(master)
$ git add hello.txt
--将暂存区的文件上传到本地库
Layne@LAPTOP-Layne  MINGW64  /d/Git-Space/pro-linghuchong/git-shTest
(master)
$ git commit -m "lhc commit" hello.txt
[master 5dabe6b] lhc commit
1 file changed, 1 insertion(+), 1 deletion(-)
--将本地库的内容 push 到远程仓库
Layne@LAPTOP-Layne  MINGW64  /d/Git-Space/pro-linghuchong/git-shTest
(master)
$ git push origin master
Logon failed, use ctrl+c to cancel basic credential prompt.
Username for 'https://github.com': atguigulinghuchong
Counting objects: 3, done.
Delta compression using up to 12 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 309 bytes | 309.00 KiB/s, done.
Total 3 (delta 1), reused 0 (delta 0)
remote: Resolving deltas: 100% (1/1), completed with 1 local object.
To https://github.com/atguiguyueyue/git-shTest.git
7cb4d02..5dabe6b master -> master

3.3.7 回到 atguiguyueyue 的 的 GitHub 远程仓库中可以看到,最后一次是 lhc 提交的。

image-20210909100835865
image-20210909100845358

3.4 ==跨团队协作==

3.4.1 将远程仓库的地址复制发给邀请跨团队协作的人,比如东方不败

image-20210909202433181

3.4.2 在东方不败的 GitHub 账号里的地址栏复制收到的链接,然后点击 Fork 将项目叉到自己的本地仓库。

image-20210909202506109

叉入中…

image-20210909202524689

叉成功后可以看到当前仓库信息。

image-20210909202540103

3.4.3 东方不败就可以在线编辑叉取过来的文件。

image-20210909202607582
image-20210909202615348

3.4.4 编辑完毕后,填写描述信息并点击左下角绿色按钮提交。

image-20210909202643682

3.4.5 接下来点击上方的 Pull 请求,并创建一个新的请求。

image-20210909202707802
image-20210909202715936
image-20210909202723337

3.4.6 回到岳岳 GitHub 账号可以看到有一个 Pull request

image-20210909202758935
image-20210909202805205

进入到聊天室,可以讨论代码相关内容。

image-20210909202822674
image-20210909202829831

3.4.7 如果代码没有问题,可以点击 Merge pull reque 合并代码。

image-20210909202859691
image-20210909202908261

四.==SSH免密登录==

4.1 我们可以看到远程仓库中还有一个 SSH 的地址,因此我们也可以使用 SSH 进行访问。

image-20210909203758078

这意味着这里没有生成SSH的key

4.2 生成SSH公钥和私钥

image-20210909210834132

4.2.1 首先进入.ssh文件夹下,确保里面空空如也(如不为空,则会有下面的冲突)

ssh-keygen -t rsa -C wei1396981310@163.com(github邮箱地址)

注意:这里-C 这个参数是大写的 C

Jason@JASON MINGW64 ~/.ssh
$ ssh-keygen -t rsa -C wei1396981310@163.com
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/13969/.ssh/id_rsa):
/c/Users/13969/.ssh/id_rsa already exists.
Overwrite (y/n)?

Jason@JASON MINGW64 ~/.ssh
$

Jason@JASON MINGW64 ~/.ssh
$ ssh-keygen -t rsa -C wei1396981310@163.com
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/13969/.ssh/id_rsa):
/c/Users/13969/.ssh/id_rsa already exists.
Overwrite (y/n)? y
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /c/Users/13969/.ssh/id_rsa.
Your public key has been saved in /c/Users/13969/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:A/eE61u01d4QTghPCW1bDMOEkHk4vjcIK2rghh6nCUI wei1396981310@163.com
The key's randomart image is:
+---[RSA 3072]----+
|        .=o*=+   |
|        =.o+=oo  |
|      ..oo..ooo  |
|      .o.+  .+ . |
| E     oSoo . +  |
|o   . ..oooo . o |
|=o o .  ..o.  . .|
|+oB      o       |
|o=      .        |
+----[SHA256]-----+
image-20210909211422868

4.2.2 查看公钥和私钥

Jason@JASON MINGW64 ~/.ssh
$ ll
total 10
-rw-r--r-- 1 Jason 197121  268  8月 17 19:37 config
-rw-r--r-- 1 Jason 197121 2610  9月  9 21:02 id_rsa
-rw-r--r-- 1 Jason 197121  575  9月  9 21:02 id_rsa.pub
-rw-r--r-- 1 Jason 197121 1117  7月 13 23:50 known_hosts

Jason@JASON MINGW64 ~/.ssh
$ cat id_rsa
-----BEGIN OPENSSH PRIVATE KEY-----
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
-----END OPENSSH PRIVATE KEY-----

Jason@JASON MINGW64 ~/.ssh
$ ^C

Jason@JASON MINGW64 ~/.ssh
$ cat id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDWNryl4OFu28/nafmTyOZJWZYSp1CgtJUHPuDaWFKR1oXtIJo+mYV/n+374X4qViKNDxJ3o9bGGigWLGfuqVYxKjngaQFZNIbsWCuGDnxqdE/UJvvv9YiHtQWL1IV++FWjztZTWvqBr+otWsSJtgAgUimD0wlkSao+XUoVHRYe1hW+mQbD

vlzzroucKX68UUamSrQfBzmnsu9PWJ5BGrlT2hTrfIGMwxS1M7WAPqxHZHGdfQ1HEtvygaSiJW93YUjLFw7j+dy2wliVRQVL3ea8kS74Iv4CrvGZqV7wdr8dy+Ptb3zLiZy1OkPrlwcOTVzOngccFJ7BfOjOosUUVYtCDYO7E2g+JaT1leXCpJ+96fmToyCXL74Cnw8ergXsjJU0VRTWt85uJebehjVWtHLajv0= wei1396981310@163.com

image-20210909212002735

4.3 复制id_rsa.pub 文件内容,登录 GitHub,点击用户头像→Settings→SSH and GPG keys

image-20210909212308183
image-20210909212320509
image-20210909212551552
image-20210909212654424

4.4 使用SSH方式

image-20210909213039152

4.4.1 用SSH的方式克隆下代码

image-20210909213415825
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 227,663评论 6 531
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 98,125评论 3 414
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 175,506评论 0 373
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 62,614评论 1 307
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 71,402评论 6 404
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 54,934评论 1 321
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 43,021评论 3 440
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 42,168评论 0 287
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 48,690评论 1 333
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 40,596评论 3 354
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 42,784评论 1 369
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 38,288评论 5 357
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 44,027评论 3 347
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 34,404评论 0 25
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 35,662评论 1 280
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 51,398评论 3 390
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 47,743评论 2 370

推荐阅读更多精彩内容