簡體   English   中英

將開發分支合並到主分支

[英]Merging develop branch into master

我有一個本地倉庫,有 2 個分支masterdevelop

  • develop分支我有我所有的 Drupal 8 核心代碼
  • 在我的master分支中,我有 1 個提交(初始提交)

在我的遠程倉庫中,我在分支develop有我所有的 Drupal 8 核心代碼。 如何在遠程主分支中獲取此代碼? 我該如何合並這些回購?

更新:

當我做git status我得到:

On branch master
Your branch is up-to-date with 'origin/master'.
Untracked files:
  (use "git add <file>..." to include in what will be committed)

    griffioenrotterdam.sublime-project
    griffioenrotterdam.sublime-workspace
    sites/

nothing added to commit but untracked files present (use "git add" to track)

我該怎么辦?

更新 2:

當我執行git checkout develop我得到:

error: The following untracked working tree files would be overwritten by checkout:
    sites/default/default.services.yml
    sites/default/default.settings.php
Please move or remove them before you can switch branches.
Aborting

我該怎么辦?

總結:你需要切換到你的開發分支,從遠程倉庫拉取代碼,然后將其合並到master(本地)並推送回遠程倉庫(到master分支)

git checkout develop
git pull origin develop
git checkout master
git merge develop
git push origin master

合並本地開發成master然后push

git checkout master
git merge develop
git push

首先將更改提交給 master

 git checkout develop
 git pull origin develop
 git checkout master
 git merge develop
 git push origin master

我認為這個過程是使用 git pull request 從 dev(remote) 合並到 master(remote)。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM