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更新原生代碼分支並將其合併到master分支的完整流程GitAST
- git合併分支Git
- Git 分支 - 分支的新建與合併Git
- git 分支合併報錯Git
- git合併單個檔案到其他分支Git
- git 知識之分支合併Git
- Git使用gh-pages分支切換到master分支錯誤pathspec master did not match any files known to gitGitAST
- 教你玩轉Git-分支合併Git
- 這才是真正的 Git——分支合併Git
- git合併分支和提交步驟Git
- git 從master建立新的分支GitAST
- git合併分支並處理衝突Git
- git合併分支,如果選擇性的合併檔案?Git
- SVN使用教程:將online分支的程式碼合併到sprint分支
- 合併分支:Git merge 和 rebase 的區別Git
- Git如何撤銷某次分支的合併MergeGit
- vscode 新建、合併分支VSCode
- git 強制拉取master分支程式碼GitAST
- Git 問題,一個 master,多個新功能分支,怎樣有序地合併和提交GitAST
- 同步master主分支,覆蓋xxx分支AST
- 【Git】合併分支報衝突怎麼解決Git
- Git merge和rebase分支合併命令的區別Git
- Git(12)-- Git 分支 - 分支簡介Git
- 【Git】3. Git重要特性-分支操作,合併衝突詳解Git
- git rebase master 分支出現一堆 ^MGitAST
- Git - 多個分支合併到 main 分支之後還存在一些 commit 無法併入一條時間線上GitAIMIT
- 簡單介紹Git合併分支的流程步驟Git
- git分支Git
- Git branch分支實質Git
- git合併某分支上的單次提交(cherry-pick)Git
- XMES合併主分支的操作
- git分支操作Git
- Git 分支管理Git
- Git 分支操作Git
- Git 使用分支Git
- git實戰-多分支開發-2022新專案Git
- Git拉取遠端分支到本地Git
- Git 教程:解密 .gitignore 檔案、合併分支、解決衝突、及 Git 幫助Git解密