国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

Git企業(yè)開發(fā)控制理論和實(shí)操-從入門到深入(六)|多人協(xié)作開發(fā)

這篇具有很好參考價(jià)值的文章主要介紹了Git企業(yè)開發(fā)控制理論和實(shí)操-從入門到深入(六)|多人協(xié)作開發(fā)。希望對(duì)大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問。

前言

那么這里博主先安利一些干貨滿滿的專欄了!

首先是博主的高質(zhì)量博客的匯總,這個(gè)專欄里面的博客,都是博主最最用心寫的一部分,干貨滿滿,希望對(duì)大家有幫助。

  • 高質(zhì)量博客匯總

然后就是博主最近最花時(shí)間的一個(gè)專欄《Git企業(yè)開發(fā)控制理論和實(shí)操》希望大家多多關(guān)注!

  • Git企業(yè)開發(fā)控制理論和實(shí)操

多人協(xié)作開發(fā)

學(xué)習(xí)案例一

案例說明

目標(biāo):在遠(yuǎn)端倉庫中master分支下的file.txt文件新增兩行代碼aaabbb
實(shí)現(xiàn):由開發(fā)者一新增aaa,由開發(fā)者二新增bbb
條件:在一個(gè)分支下協(xié)作完成。

準(zhǔn)備工作

當(dāng)然我們說過,遠(yuǎn)端的master分支一定是一個(gè)穩(wěn)定的分支,不能用于開發(fā)。所以現(xiàn)在先在遠(yuǎn)端創(chuàng)建一個(gè)dev分支。

Git企業(yè)開發(fā)控制理論和實(shí)操-從入門到深入(六)|多人協(xié)作開發(fā),Git企業(yè)開發(fā)控制理論和實(shí)操,git,Linux,Gitee,Github
Git企業(yè)開發(fā)控制理論和實(shí)操-從入門到深入(六)|多人協(xié)作開發(fā),Git企業(yè)開發(fā)控制理論和實(shí)操,git,Linux,Gitee,Github

當(dāng)然現(xiàn)在本地(云服務(wù)器)看不到遠(yuǎn)端的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]$ 

現(xiàn)在本地就有遠(yuǎn)程的dev分支了。

注意:要區(qū)分本地的dev分支和本地所知道的遠(yuǎn)程的dev分支。

  • 本地的master分支叫做master

  • 遠(yuǎn)端的master在本地叫做origin/master

  • 遠(yuǎn)端的dev在本地叫做origin/dev

都是不一樣的。

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

然后上面把我的阿里云服務(wù)器上的倉庫準(zhǔn)備好了,我們再準(zhǔn)備一個(gè)本地(maxOS本地)的一個(gè)remote倉庫。

(base) [demac@YuMacBook-Air:Git企業(yè)開發(fā)精品課程]$ 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企業(yè)開發(fā)精品課程]$
開始開發(fā)

讓協(xié)作者一完成aaa的更新,協(xié)作者二完成bbb的更新。

首先是開發(fā)者一:

看一下這行命令。

git checkout -b dev origin/dev

這行命令完成了三件事。

  • 在本地創(chuàng)建了一個(gè)dev分支
  • 切到dev分支下
  • 讓本地的dev分支和遠(yuǎn)程的origin/dev分支建立了一個(gè)連接

如何查看這個(gè)連接呢?

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

新增一行aaa。

Git企業(yè)開發(fā)控制理論和實(shí)操-從入門到深入(六)|多人協(xié)作開發(fā),Git企業(yè)開發(fā)控制理論和實(shí)操,git,Linux,Gitee,Github

然后add,commit,push到遠(yuǎn)程的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: aaa
 1 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 matching

To squelch this message and adopt the new behavior now, use:

  git config --global push.default simple

See '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.git
   7393ea0..7c49864  dev -> dev
(base) [yufc@ALiCentos7:~/Src/Bit-Courses/GitDevelopment/remote-gitcode]$

然后是開發(fā)者二:

(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: bbb
 Committer: ??的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.com

After doing this, you may fix the identity used for this commit with:

    git commit --amend --reset-author

 1 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]$

我們發(fā)現(xiàn),git拒絕了我們的推送。

這是因?yàn)?,遠(yuǎn)程的dev分支下現(xiàn)在是有一行aaa的,而如果我們推送,就會(huì)沖突!

所以我們要先使用git pull把遠(yuǎn)程的東西先拉下來。

Git企業(yè)開發(fā)控制理論和實(shí)操-從入門到深入(六)|多人協(xié)作開發(fā),Git企業(yè)開發(fā)控制理論和實(shí)操,git,Linux,Gitee,Github

(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] merge
 Committer: ??的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.com

After doing this, you may fix the identity used for this commit with:

    git commit --amend --reset-author

 1 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, use

    git 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.git
   7c49864..a37671a  HEAD -> dev
(base) [demac@YuMacBook-Air:remote-gitcode]$ 

這樣就可以了。

Git企業(yè)開發(fā)控制理論和實(shí)操-從入門到深入(六)|多人協(xié)作開發(fā),Git企業(yè)開發(fā)控制理論和實(shí)操,git,Linux,Gitee,Github

將origin/dev合并到origin/master中
PR方式

現(xiàn)在master分支是沒有后面兩行代碼的。
Git企業(yè)開發(fā)控制理論和實(shí)操-從入門到深入(六)|多人協(xié)作開發(fā),Git企業(yè)開發(fā)控制理論和實(shí)操,git,Linux,Gitee,Github
要用pull request

Git企業(yè)開發(fā)控制理論和實(shí)操-從入門到深入(六)|多人協(xié)作開發(fā),Git企業(yè)開發(fā)控制理論和實(shí)操,git,Linux,Gitee,Github

提交PR之后,開發(fā)人員要做的事情就已經(jīng)做完了。

審查人員通過看這個(gè)PR單子,文件改動(dòng)這些信息,可以選擇通過PR或拒絕PR。

Git企業(yè)開發(fā)控制理論和實(shí)操-從入門到深入(六)|多人協(xié)作開發(fā),Git企業(yè)開發(fā)控制理論和實(shí)操,git,Linux,Gitee,Github

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

學(xué)習(xí)案例二

案例說明

目標(biāo):遠(yuǎn)程master分支下新增funciton1和function2文件

實(shí)現(xiàn):由開發(fā)者1新增function1,開發(fā)者2新增function2

條件:在不同分支下協(xié)作完成(各自私有一個(gè)分支)

開始開發(fā)

開發(fā)者一:

(base) [yufc@ALiCentos7:~/Src/Bit-Courses/GitDevelopment/remote-gitcode]$ git branch -a
* dev
  master
  remotes/origin/HEAD -> origin/master
  remotes/origin/dev
  remotes/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-1
 1 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]$

新增了一個(gè)function-1文件,然后直接推送到遠(yuǎn)程,遠(yuǎn)程就會(huì)多一個(gè)feature-1分支。

Git企業(yè)開發(fā)控制理論和實(shí)操-從入門到深入(六)|多人協(xié)作開發(fā),Git企業(yè)開發(fā)控制理論和實(shí)操,git,Linux,Gitee,Github

開發(fā)者二:

(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-2
 Committer: ??的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.com

After doing this, you may fix the identity used for this commit with:

    git commit --amend --reset-author

 1 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]$

Git企業(yè)開發(fā)控制理論和實(shí)操-從入門到深入(六)|多人協(xié)作開發(fā),Git企業(yè)開發(fā)控制理論和實(shí)操,git,Linux,Gitee,Github

此時(shí)目前到這里,我們沒有發(fā)生任何沖突!

這是因?yàn)椋麄兪撬接幸粋€(gè)分支的,所以沒有沖突。

但天有不測風(fēng)云,你的小伙伴突然生病了,但需求還沒開發(fā)完,需要你幫他繼續(xù)開發(fā),于是他便把feature-2 分支名告訴你了。這時(shí)你就需要在自己的機(jī)器上切換到 feature-2 分支幫忙繼續(xù)開發(fā)。

這就回到了:多名開發(fā)者在一個(gè)機(jī)器上開發(fā)的情況了。

那么對(duì)于開發(fā)者一來說,我首先需要獲得feature-2這個(gè)分支。

先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-2
   7393ea0..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 details

    git 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 -a
  dev
* feature-1
  master
  remotes/origin/HEAD -> origin/master
  remotes/origin/dev
  remotes/origin/feature-1
  remotes/origin/feature-2
  remotes/origin/master
(base) [yufc@ALiCentos7:~/Src/Bit-Courses/GitDevelopment/remote-gitcode]$

雖然直接git pull會(huì)報(bào)錯(cuò),但是我們看到,確實(shí)origin/feature-2分支能被本地看到了。

這是為什么?

git pull

  • 拉取分支內(nèi)的內(nèi)容(一定要建立連接后才能使用短的git pull命令)
  • 拉取倉庫內(nèi)容(可以直接拉,不需要分支建立連接,因?yàn)楹头种П緛砭蜎]關(guān)系)

此時(shí),我們就要在本地創(chuàng)建一個(gè)feature-2分支,并和遠(yuǎn)程的origin/feature-2分支建立聯(lián)系?!?/p>

(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 branch
  dev
  feature-1
* feature-2
  master
(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 1
 1 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 matching

To squelch this message and adopt the new behavior now, use:

  git config --global push.default simple

See '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.git
   2a63bd0..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]$

此時(shí)遠(yuǎn)程就有了開發(fā)者一為開發(fā)者二寫的內(nèi)容了。

當(dāng)然,如果此時(shí)開發(fā)者二說自己病好了,那么他想繼續(xù)開發(fā)。

此時(shí)的開發(fā)者二是看不到開發(fā)者一新增的內(nèi)容了,所以,pull一下即可。

開發(fā)者二:

(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 -vv
  dev       220f739 [origin/dev: ahead 1, behind 2] md file.txt: bbb
* feature-2 2a63bd0 [origin/feature-2] add function-2
  master    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-gitcode
   2a63bd0..280238d  feature-2  -> origin/feature-2
Updating 2a63bd0..280238d
Fast-forward
 function-2 | 2 ++
 1 file changed, 2 insertions(+)
(base) [demac@YuMacBook-Air:remote-gitcode]$ 

開發(fā)好之后push上去就行了。

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

這里我們用PR的方式。

Git企業(yè)開發(fā)控制理論和實(shí)操-從入門到深入(六)|多人協(xié)作開發(fā),Git企業(yè)開發(fā)控制理論和實(shí)操,git,Linux,Gitee,Github

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

然后就等審查人員通過PR即可。

Git企業(yè)開發(fā)控制理論和實(shí)操-從入門到深入(六)|多人協(xié)作開發(fā),Git企業(yè)開發(fā)控制理論和實(shí)操,git,Linux,Gitee,Github

當(dāng)然,按照之前的建議,我們其實(shí)不能像上面那樣去合并。

要先讓feature-2去合并master,如果有bug,也不會(huì)影響master,大家可以參考之前的章節(jié)。

解決git branch -a顯示已經(jīng)被刪除的遠(yuǎn)程分支的方法

就是,開發(fā)完成之后,遠(yuǎn)程刪除feature-1和feature-2這兩個(gè)分支了。

但是git branch -a在本地還是能夠顯示feature-1和feature-2這兩個(gè)分支,這是不好的。

Git企業(yè)開發(fā)控制理論和實(shí)操-從入門到深入(六)|多人協(xié)作開發(fā),Git企業(yè)開發(fā)控制理論和實(shí)操,git,Linux,Gitee,Github

git remote show origin

這個(gè)命令可以看到遠(yuǎn)程的一些信息。

(base) [yufc@ALiCentos7:~/Src/Bit-Courses/GitDevelopment/remote-gitcode]$ git remote show origin
* remote origin
  Fetch URL: git@gitee.com:Yufch/remote-gitcode.git
  Push  URL: git@gitee.com:Yufch/remote-gitcode.git
  HEAD branch: master
  Remote branches:
    feature-1               tracked
    feature-2               tracked
    master                  tracked
    refs/remotes/origin/dev stale (use 'git remote prune' to remove) # 他這里會(huì)建議我們?nèi)h除這些分支
  Local branches configured for 'git pull':
    dev       merges with remote dev
    feature-2 merges with remote feature-2
    master    merges with remote master
  Local 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 # 這個(gè)命令可以去修剪一些已經(jīng)被刪除的分支
(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]$

這里顯示已經(jīng)幫我們刪除了dev分支了。文章來源地址http://www.zghlxwxcb.cn/news/detail-676680.html

到了這里,關(guān)于Git企業(yè)開發(fā)控制理論和實(shí)操-從入門到深入(六)|多人協(xié)作開發(fā)的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場。本站僅提供信息存儲(chǔ)空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請點(diǎn)擊違法舉報(bào)進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • Git企業(yè)開發(fā)控制理論和實(shí)操-從入門到深入(四)|Git的遠(yuǎn)程操作|Gitee

    Git企業(yè)開發(fā)控制理論和實(shí)操-從入門到深入(四)|Git的遠(yuǎn)程操作|Gitee

    那么這里博主先安利一些干貨滿滿的專欄了! 首先是博主的高質(zhì)量博客的匯總,這個(gè)專欄里面的博客,都是博主最最用心寫的一部分,干貨滿滿,希望對(duì)大家有幫助。 高質(zhì)量博客匯總 然后就是博主最近最花時(shí)間的一個(gè)專欄《Git企業(yè)開發(fā)控制理論和實(shí)操》希望大家多多關(guān)注!

    2024年02月11日
    瀏覽(41)
  • Git企業(yè)開發(fā)控制理論和實(shí)操-從入門到深入(一)|為什么需要Git|Git的安裝

    那么這里博主先安利一些干貨滿滿的專欄了! 首先是博主的高質(zhì)量博客的匯總,這個(gè)專欄里面的博客,都是博主最最用心寫的一部分,干貨滿滿,希望對(duì)大家有幫助。 高質(zhì)量博客匯總 https://blog.csdn.net/yu_cblog/category_12379430.html 然后就是博主最近最花信息的一個(gè)專欄《Git企業(yè)開

    2024年02月11日
    瀏覽(23)
  • 【掌握版本控制:Git 入門與實(shí)踐指南】多人協(xié)作

    【掌握版本控制:Git 入門與實(shí)踐指南】多人協(xié)作

    ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ??慕斯主頁 : 修仙—?jiǎng)e有洞天 ?? ????????????????????????????????????????? ??? 今日夜電波: 泥中に咲く—ウォルピスカーター ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?

    2024年03月16日
    瀏覽(29)
  • Git 多人協(xié)作開發(fā)

    任務(wù)名稱: 任務(wù)描述: 任務(wù)優(yōu)先級(jí):1(1最優(yōu)先) 周期:10ms和1ms README.md為markdown語言編寫的文件,可使用 typora 軟件進(jìn)行讀寫。 版本 時(shí)間 更新說明 修訂者 V0.1 2023/10/27 base版本 在主庫已經(jīng)存在的情況下,日常操作流程如下: Git 全局設(shè)置

    2024年04月10日
    瀏覽(37)
  • Git分支——多人協(xié)作開發(fā)

    Git分支——多人協(xié)作開發(fā)

    Git分支可以將主線任務(wù)(項(xiàng)目)分為若干個(gè)分支,一個(gè)或若干個(gè)人操控一個(gè)分支,在同一時(shí)間點(diǎn)各司其職,完成相對(duì)應(yīng)的工作,各分支完成之后總匯在主線任務(wù)上,在最短的時(shí)間內(nèi)完成項(xiàng)目需求,實(shí)現(xiàn)多人協(xié)作開發(fā) 多人協(xié)作開發(fā)不僅僅節(jié)省時(shí)間,還能防止互相干擾,每一個(gè)具

    2023年04月08日
    瀏覽(31)
  • Git--多人協(xié)作開發(fā)

    Git--多人協(xié)作開發(fā)

    目前,我們所完成的工作如下 : 基本完成Git的所有本地庫的相關(guān)操作,git基本操作,分支理解,版本回退,沖突解決等等 申請碼云賬號(hào),將遠(yuǎn)端信息clone到本地,以及推送和拉取 正文開始!!! 是時(shí)候干最重要的一件事情了,實(shí)現(xiàn)多人協(xié)作開發(fā)!為了這件事情,我們需要先做一些準(zhǔn)備工作.我們

    2024年02月09日
    瀏覽(33)
  • 如何部署 Git 實(shí)現(xiàn)多人協(xié)同開發(fā)

    如何部署 Git 實(shí)現(xiàn)多人協(xié)同開發(fā)

    ??歡迎來到Java學(xué)習(xí)路線專欄~如何部署 Git 實(shí)現(xiàn)多人協(xié)同開發(fā) ☆* o(≧▽≦)o *☆嗨~我是IT·陳寒?? ?博客主頁:IT·陳寒的博客 ??該系列文章專欄:Java學(xué)習(xí)路線 ??其他專欄:Java學(xué)習(xí)路線 Java面試技巧 Java實(shí)戰(zhàn)項(xiàng)目 AIGC人工智能 數(shù)據(jù)結(jié)構(gòu)學(xué)習(xí) ??文章作者技術(shù)和水平有限,如果

    2024年02月04日
    瀏覽(29)
  • 用Git遠(yuǎn)程倉庫實(shí)現(xiàn)多人協(xié)同開發(fā)

    用Git遠(yuǎn)程倉庫實(shí)現(xiàn)多人協(xié)同開發(fā)

    (創(chuàng)作不易,感謝有你,你的支持,就是我前行的最大動(dòng)力,如果看完對(duì)你有幫助,請留下您的足跡) 目錄 分支 初識(shí)分支 分支-合并與刪除 分支-合并與提交 分支-合并沖突 Git 常用命令 Git 遠(yuǎn)程倉庫? Git 遠(yuǎn)程倉庫-克隆? 多人協(xié)同開發(fā)? Git 常用命令 ??編輯 概念 :本質(zhì)上是指

    2024年02月15日
    瀏覽(21)
  • 微信小程序多人協(xié)同開發(fā)(Git)

    微信小程序多人協(xié)同開發(fā)(Git)

    Git的安裝我就省略了,大家可以自行去看相關(guān)的文章。 首頁點(diǎn)擊\\\'版本管理\\\' 首次點(diǎn)擊會(huì)跳出該彈窗,點(diǎn)擊\\\'初始化Git倉庫\\\' 兩個(gè)選項(xiàng)都勾選,如果還沒建立遠(yuǎn)程倉庫可點(diǎn)擊下方鏈接 微信開發(fā)者-代碼管理 設(shè)置個(gè)人密碼和賬戶名,創(chuàng)建項(xiàng)目 點(diǎn)擊\\\'設(shè)置\\\'-\\\'遠(yuǎn)程\\\' 添加遠(yuǎn)程倉庫,名稱可

    2024年02月03日
    瀏覽(23)
  • 如何使用 Git 進(jìn)行多人協(xié)作開發(fā)(全流程圖解)

    如何使用 Git 進(jìn)行多人協(xié)作開發(fā)(全流程圖解)

    ?在軟件開發(fā)中,多人協(xié)作是一項(xiàng)必不可少的任務(wù)。而 Git 作為目前最受歡迎的分布式版本控制工具,提供了強(qiáng)大的功能和靈活的工作流程,使得多人協(xié)作開發(fā)變得更加高效。本篇博客將帶你實(shí)踐如何正確使用 Git 進(jìn)行多人協(xié)作開發(fā) ?在本篇博客中,你將學(xué)到以下內(nèi)容: Fea

    2024年02月05日
    瀏覽(32)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包