squash

Combine or rebase an arbitrarily large number of commits

谁说胖子不能爱 提交于 2019-11-28 23:19:45
问题 Let's say my local git log shows: 739b36d3a314483a2d4a14268612cd955c6af9fb a ... c42fff47a257b72ab3fabaa0bcc2be9cd50d5c89 x c4149ba120b30955a9285ed721b795cd2b82dd65 y dce99bcc4b79622d2658208d2371ee490dff7d28 z My remote git log shows: c4149ba120b30955a9285ed721b795cd2b82dd65 y dce99bcc4b79622d2658208d2371ee490dff7d28 z What's the easiest way to get to this ( assuming an arbitrarily large number of local commits ): 527b5810cfd8f45f18ae807af1fe1e54a0312bce a ... x

How does the new Docker --squash work

霸气de小男生 提交于 2019-11-28 16:39:22
问题 In Docker 1.13 the new --squash parameter was added. I'm now hoping to reduce the size of my images as well as being able to "hide" secret files I have in my layers. Below you can now see the difference from doing a build with and without the --squash parameter. Without Squash With Squash Now to my question. If I add a secret file in my first layer, then use the secret file in my second layer, and the finally remove my secret file in the third layer, and then build with the --squash flag.

What are the differences between `--squash` and `--no-ff --no-commit`?

筅森魡賤 提交于 2019-11-28 16:27:06
问题 Which one should one use to hide microcommits? Is the only difference between git merge --squash and git merge --no-ff --no-commit the denial of the other parents? 回答1: The differences These options exists for separate purposes. Your repository ends up differently. Let's suppose that your repository is like this after you are done developing on the topic branch: --squash If you checkout master and then git merge --squash topic; git commit -m topic , you get this: --no-ff --no-commit Instead,

Differences between Git merge --squash and --no-commit

匆匆过客 提交于 2019-11-28 16:12:48
问题 As the title says, I am not really clear about the differences between a git merge --squash and a git merge --no-commit . As far as I understand the help page for git merge , both commands would leave me in an updated working-tree, where it is still possible to edit and then to do a final commit (or multiple commits). Could someone clarify the differences of those 2 options? When would I use one instead of the other? 回答1: git merge --no-commit This is just like a normal merge but doesn't

How to squash/rebase in a single shot

a 夏天 提交于 2019-11-28 13:14:00
How can I, with minimum effort, squash all my commits (even with merges and conflict resolutions) to a single one on a feature branch and then rebase on top of the branch where I started developing from? Don't want to redo conflict resolution that's already done . Keep hassle to a minimum. Suppose the branches we are talking about are master and featureX. The simplest way I know is git checkout featureX git merge -m "Bring latest changes from master" master # magic starts here git reset --soft master # put featureX branch pointer on top of master tip # at this point all the changes related to

Git: Squashing consecutive commits that are not the most recent commits, and do not start at the root

主宰稳场 提交于 2019-11-28 10:26:00
I have reviewed several related questions about squashing the most recent commits and squashing a commit at the root , but neither will help me squash non-recent commits that are not at the root. Here is my starting scenario: D---E---F---G---H---I---J master and my desired result: D---E---Z---I---J master where Z is the squash of F---G---H , and F---G---H , D---E , and I---J can be an arbitrarily long sequence of non-branching commits. First approach: [lucas]/home/blah/$ git rebase -i D rebase in progress; onto D You are currently editing a commit while rebasing branch 'master' on 'D'. No

git rebase interactive: squash merge commits together

蹲街弑〆低调 提交于 2019-11-28 03:08:20
I wanted to have a simple solution to squash two merge commits together during an interactive rebase. My repository looks like: X --- Y --------- M1 -------- M2 (my-feature) / / / / / / a --- b --- c --- d --- e --- f (stable) That is, I have a my-feature branch that has been merged twice recently, with no real commits in between. I don't just want to rebase the my-feature branch since it is a published branch of its own, I just want to squash together the last two merge commits into one (haven't published those commits yet) X --- Y ---- M (my-feature) / / / / a --- ... -- f (stable) I tried:

Git squash history after merge

大憨熊 提交于 2019-11-28 03:00:23
问题 I merged an upstream of a large project with my local git repo. Prior to the merge I had a small amount of history that was easy to read through, but after the merge a massive amount of history is now in my repo. I have no need for all the history commits from the upstream repo. There have been other commits made after this upstream merge that I would like to keep. How do I squash all that history that was merged from the upstream into one commit while keeping the commits made after the

How does squashing, rebasing, reset --soft affect github contributions page?

廉价感情. 提交于 2019-11-28 01:55:45
问题 For some projects I do or work on sometimes it is usually best that we squash/rebase all changes into a single commit. However, I was wondering how this affects the contributions page on github. For example, if I spent 2 months pushing changes to a project I created and then after 2 months decided to rebase it to one single commit, would github remove all the contribution cubes on the map for the past two months? 回答1: I saw this still here so I figured I might as well answer the question. So

How to squash/rebase in a single shot

做~自己de王妃 提交于 2019-11-27 07:31:59
问题 How can I, with minimum effort, squash all my commits (even with merges and conflict resolutions) to a single one on a feature branch and then rebase on top of the branch where I started developing from? Don't want to redo conflict resolution that's already done . Keep hassle to a minimum. Suppose the branches we are talking about are master and featureX. 回答1: First check with git branch , what's your current working branch. Next, if it isn't featureX already, switch to it, using git checkout