Git dev分支合併到master分支完美實戰
aa@aa-PC MINGW64 /f/online-center/cloud/server-functions_services (master)
$ git branch -a #先檢視下當前的本地和遠端分支
* master
remotes/origin/HEAD -> origin/master
remotes/origin/dev
remotes/origin/master
aa@aa-PC MINGW64 /f/online-center/cloud/server-functions_services (master)
$ git checkout -b my_dev origin/dev #或者是切換到本地的my_dev分支,假如已經存在的話,即git checkout my_dev
Switched to a new branch 'my_dev'
Branch 'my_dev' set up to track remote branch 'dev' from 'origin'.
aa@aa-PC MINGW64 /f/online-center/cloud/server-functions_services (my_dev)
$ git pull #將本地分支my_dev對應的遠端分支dev拉下來
remote: Counting objects: 33, done.
remote: Compressing objects: 100% (20/20), done.
remote: Total 33 (delta 11), reused 32 (delta 10)
Unpacking objects: 100% (33/33), done.
From 192.168.5.222:interlive/cloud/server-functions_services
9b3c7c5..dcdb51b dev -> origin/dev
Updating 9b3c7c5..dcdb51b
Fast-forward
content/pom.xml | 24 +-
.../java/com/interlive/services/common/Constant.java | 4 +
.../com/interlive/services/common/RedisClient.java | 7 -
create mode 100644 content/src/test/java/com/interlive/services/controller/ControllerTest.java
aa@aa-PC MINGW64 /f/online-center/cloud/server-functions_services (my_dev)
$ git checkout master #切換到master分支
Switched to branch 'master'
Your branch is up to date with 'origin/master'.
aa@aa-PC MINGW64 /f/online-center/cloud/server-functions_services (master)
$ git pull #確保master分支也是最新的
Already up to date.
aa@aa-PC MINGW64 /f/online-center/cloud/server-functions_services (master)
$ git merge my_dev #執行合併的關鍵程式碼,此時執行結果時將本地的my_dev合併到本地master分支
hint: Waiting for your editor to close the file... Auto-merging content/src/main/java/com/interlive/services/common/Constant.java
Merge made by the 'recursive' strategy.
content/db/.sql | 34 +++++++++
.../java/com/interlive/services/common/Constant.java | 4 +
16 files changed, 490 insertions(+), 9 deletions(-)
create mode 100644 content/src/main/java/com/interlive/services/controller/Controller.java
aa@aa-PC MINGW64 /f/online-center/cloud/server-functions_services (master)
$ git push origin master #將合併的本地master分支推送到遠端master
Counting objects: 16, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (13/13), done.
Writing objects: 100% (16/16), 1.48 KiB | 504.00 KiB/s, done.
Total 16 (delta 9), reused 0 (delta 0)
To 192.168.5.222:interlive/cloud/server-functions_services.git
d970c11..edaa065 master -> master
$ git branch -a #先檢視下當前的本地和遠端分支
* master
remotes/origin/HEAD -> origin/master
remotes/origin/dev
remotes/origin/master
aa@aa-PC MINGW64 /f/online-center/cloud/server-functions_services (master)
$ git checkout -b my_dev origin/dev #或者是切換到本地的my_dev分支,假如已經存在的話,即git checkout my_dev
Switched to a new branch 'my_dev'
Branch 'my_dev' set up to track remote branch 'dev' from 'origin'.
aa@aa-PC MINGW64 /f/online-center/cloud/server-functions_services (my_dev)
$ git pull #將本地分支my_dev對應的遠端分支dev拉下來
remote: Counting objects: 33, done.
remote: Compressing objects: 100% (20/20), done.
remote: Total 33 (delta 11), reused 32 (delta 10)
Unpacking objects: 100% (33/33), done.
From 192.168.5.222:interlive/cloud/server-functions_services
9b3c7c5..dcdb51b dev -> origin/dev
Updating 9b3c7c5..dcdb51b
Fast-forward
content/pom.xml | 24 +-
.../java/com/interlive/services/common/Constant.java | 4 +
.../com/interlive/services/common/RedisClient.java | 7 -
create mode 100644 content/src/test/java/com/interlive/services/controller/ControllerTest.java
aa@aa-PC MINGW64 /f/online-center/cloud/server-functions_services (my_dev)
$ git checkout master #切換到master分支
Switched to branch 'master'
Your branch is up to date with 'origin/master'.
aa@aa-PC MINGW64 /f/online-center/cloud/server-functions_services (master)
$ git pull #確保master分支也是最新的
Already up to date.
aa@aa-PC MINGW64 /f/online-center/cloud/server-functions_services (master)
$ git merge my_dev #執行合併的關鍵程式碼,此時執行結果時將本地的my_dev合併到本地master分支
hint: Waiting for your editor to close the file... Auto-merging content/src/main/java/com/interlive/services/common/Constant.java
Merge made by the 'recursive' strategy.
content/db/.sql | 34 +++++++++
.../java/com/interlive/services/common/Constant.java | 4 +
16 files changed, 490 insertions(+), 9 deletions(-)
create mode 100644 content/src/main/java/com/interlive/services/controller/Controller.java
aa@aa-PC MINGW64 /f/online-center/cloud/server-functions_services (master)
$ git push origin master #將合併的本地master分支推送到遠端master
Counting objects: 16, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (13/13), done.
Writing objects: 100% (16/16), 1.48 KiB | 504.00 KiB/s, done.
Total 16 (delta 9), reused 0 (delta 0)
To 192.168.5.222:interlive/cloud/server-functions_services.git
d970c11..edaa065 master -> master
相關文章
- git合併分支Git
- git更新原生代碼分支並將其合併到master分支的完整流程GitAST
- Git 分支 - 分支的新建與合併Git
- Git 分支與合併Git
- git 分支合併報錯Git
- git分支合併與rebaseGit
- git合併單個檔案到其他分支Git
- git 知識之分支合併Git
- Git 分支 - 分支的衍合Git
- 這才是真正的 Git——分支合併Git
- 教你玩轉Git-分支合併Git
- git合併分支和提交步驟Git
- Git——如何從master檢出分支dev並推送到遠端?GitASTdev
- Git使用gh-pages分支切換到master分支錯誤pathspec master did not match any files known to gitGitAST
- 圖解4種git合併分支方法圖解Git
- git 從master建立新的分支GitAST
- git 當前分支 master 沒有對應的上游分支。GitAST
- git合併分支,如果選擇性的合併檔案?Git
- Git如何撤銷某次分支的合併MergeGit
- 【Git】合併分支報衝突怎麼解決Git
- 合併分支:Git merge 和 rebase 的區別Git
- SVN使用教程:將online分支的程式碼合併到sprint分支
- Git(12)-- Git 分支 - 分支簡介Git
- Git 問題,一個 master,多個新功能分支,怎樣有序地合併和提交GitAST
- git 強制拉取master分支程式碼GitAST
- TortoiseGIT建立及合併分支Git
- 【Git】3. Git重要特性-分支操作,合併衝突詳解Git
- Git - 多個分支合併到 main 分支之後還存在一些 commit 無法併入一條時間線上GitAIMIT
- Git merge和rebase分支合併命令的區別Git
- 簡單介紹Git合併分支的流程步驟Git
- git小技巧--提取/合併某分支的部分檔案Git
- git分支Git
- Git 分支Git
- git rebase master 分支出現一堆 ^MGitAST
- Git branch分支實質Git
- vscode 新建、合併分支VSCode
- git合併某分支上的單次提交(cherry-pick)Git
- git切換到遠端分支Git