简体   繁体   English

合并开发和主分支

[英]Merge develop and master branches

I am newbie in git (github).我是 git (github) 的新手。 I have just one simple question.我只有一个简单的问题。 There are two branches on github. github上有两个分支。 One is master branch, that contains old code, and the other one is develop branch, that contains the latest code.一个是 master 分支,包含旧代码,另一个是 develop 分支,包含最新代码。 How I can merge these branches, so that the master branch will contain the latest code I have written on develop branch.如何合并这些分支,以便 master 分支包含我在 develop 分支上编写的最新代码。 Thanks much in advance.非常感谢。

git merge will help you: git merge将帮助你:

git clone https://github.com/youraccount/yourproject.git
git checkout --tract origin/develop
git checkout master
git merge develop
git push

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM