Git合并扁平化 [英] Git merge flattening

查看:530
本文介绍了Git合并扁平化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我在单个功能上的多个分支中工作,我使用 git pull branch1 branch2 branch3 将所有更改拉到我的主分支中。但是,每个分支的所有提交日志也会被复制。如何将提交日志平放到单个消息中?

If I am working in multiple branches on a single feature, I use git pull branch1 branch2 branch3 to pull all the changes into my master branch. However, all the commit logs of each branch are copied as well. How do I flatten the commit log down to a single message?

推荐答案

您可以使用交互式 rebase 和挤压提交 - 另见 Git准备教程通过重组压扁。对不起,只是转储一个链接,但这是一个非常彻底的教程。哦,这也会压缩你的合并。

You can use interactive rebase and "squash" the commits -- see also the Git Ready Tutorial on squashing via rebase. Sorry to just dump a link on you but that's a pretty thorough tutorial. Oh, and this will also squash away your merges just fine.

这篇关于Git合并扁平化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆