简体   繁体   中英

How to merge code of two person working on same branch with different commits?

I and my colleague is working on a django (python) project and pushing our code on same branch(lets say branch1), as a beginner i know how to push the code on a particular branch but have no idea how pull and merge can be done. what should i do if i want full project including his codes and my codes together without overriding the whole file(lets say he made views1.py and i made views2.py, then after merge and all, the result must be views3.py)

  • now views3.py contains my code and his code.

Any kind of help would be appreciated.

You're welcome! git docs

And one important thing. It makes no sense to work together on the same branch...

well i completely understood what github exactly is, and also be aware that to work in a same branch for two people is not even a good idea. to work in a different branch, push your piece of code in it on daily basis and merge them solving the conflicts is always recommended.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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