Remove excess Merge branch submitted

Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
//Blog.csdn.net/xuexingyang/article/details/53939338: This link: https
remove excess Merge branch submitted

when the project development, there is often this happens, the development over a new feature, submit to a remote repository and found that the failure to submit (their other colleagues have made changes), come to pull the latest code can then be submitted. But this time there will be an annoying redundancy submission (Merge branch ......), such as adding a local file1, file2 while other colleagues added a step ahead and submit to a remote repository. When I have to submit updated code. At this historic project will be submitted as follows:

    e76dfc4216d797af0f093a8121b9a586d4d33ce6 Merge branch 'Master' of https://github.com/XXX/helloworld
    20171e3a0ed95a6b6a920cda8d7837fff2b393db file2 from the Create Remote
    accf96f77485502f918b56007eb39af687674755 the Add file1 from local

how to cancel Merge branch annoying submit it? The commit history into a simple one:

accf96f77485502f918b56007eb39af687674755 the Add file1 from local
20171e3a0ed95a6b6a920cda8d7837fff2b393db file2 from the Create Remote

Solution (assuming the master branch) only execute the following commands

git rebase origin / master

then commit (git push origin master) can.


In my work, I found the following problems:



There are two extra "Merge branch ..."

run the following command will be solved.
----------------
Disclaimer: This article is the original article CSDN bloggers "xuexingyang", and follow CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement. .
Original link: https: //blog.csdn.net/dxdxsmy/article/details/53939338

Guess you like

Origin www.cnblogs.com/xiang--liu/p/11542061.html