简体   繁体   English

将开发分支合并到主分支

[英]Merging develop branch into master

I have a local repo with 2 branches master and develop .我有一个本地仓库,有 2 个分支masterdevelop

  • in develop branch I have all my Drupal 8 core codedevelop分支我有我所有的 Drupal 8 核心代码
  • in my master branch I have 1 commit (Initial commit)在我的master分支中,我有 1 个提交(初始提交)

On my remote repo I have all my Drupal 8 core code in branch develop .在我的远程仓库中,我在分支develop有我所有的 Drupal 8 核心代码。 How do I get this code in the remote master branch?如何在远程主分支中获取此代码? How do I have to merge those repo's?我该如何合并这些回购?

Update:更新:

When I do git status I get:当我做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)

What do I have to do?我该怎么办?

Update 2:更新 2:

When I do git checkout develop I get:当我执行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

What do I have to do?我该怎么办?

Summary: you need to switch to your develop branch, pull the code from the remote repo, then merge it into master (locally) and push it back to remote repo (into master branch)总结:你需要切换到你的开发分支,从远程仓库拉取代码,然后将其合并到master(本地)并推送回远程仓库(到master分支)

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

Merge locally develop into master and then push合并本地开发成master然后push

git checkout master
git merge develop
git push

First commit your changes to master首先将更改提交给 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