简体   繁体   English

如何在github中合并代码?

[英]How to merge code in github?

I am new to github. 我是github的新手。

I want to share code with my teammates. 我想与队友共享代码。

Suppose i have a js file having code {previous code}; 假设我有一个代码为{previous code}的js文件;
i pushed this to github remote. 我将此推送到github远程。

now my friend pulled the remote repository and made some changes . 现在我的朋友拉了远程仓库并做了一些修改。
let it be {previous code} + {new code 1} . 使其为{previous code} + {new code 1}

Now i made some changes. 现在,我进行了一些更改。 let {previous code} + {new code 2} . {previous code} + {new code 2} now how to get this all code at one place by merging. 现在如何通过合并将所有这些代码集中到一个地方。 ie {previous code} + {new code 1} + {new code 2} {previous code} + {new code 1} + {new code 2}

more info: we are using webstorm IDE. 更多信息:我们正在使用Webstorm IDE。

If you work on the same branch you simply have to pull the code from Github. 如果您在同一分支上工作,则只需从Github中提取代码。
If you use different branches, you will need to merge your changes. 如果使用其他分支,则需要合并更改。 You can do it locally with Webstorm. 您可以使用Webstorm在本地进行。


在此处输入图片说明


Here is a screenshot where to find the git command under webstorm. 这是一个截图,可在webstorm下找到git命令。

在此处输入图片说明

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

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