squash

Squash all my commits into one for GitHub pull request [duplicate]

跟風遠走 提交于 2019-11-27 06:39:55
This question already has an answer here: Squash my last X commits together using Git 31 answers I made a pull request on GitHub. Now the owner of the repository is saying to squash all the commits into one. When I type git rebase -i Notepad opens with the following content: noop # Rebase 0b13622..0b13622 onto 0b13622 # # Commands: # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash = use commit, but meld into previous commit # f, fixup = like "squash", but discard this commit's log message # x, exec = run

Is there a way to squash a number of commits non-interactively?

可紊 提交于 2019-11-27 06:07:19
I'm trying to squash a range of commits - HEAD to HEAD~3. Is there a quick way to do this, or do I need to use rebase --interactive? Make sure your working tree is clean, then git reset --soft HEAD~3 git commit -m'new commit message' n8tr I personally like wilhelmtell's solution: git reset --soft HEAD~3 git commit -m 'new commit message' However, I made an alias with some error checking so that you can do this: git squash 3 'my commit message' I recommend setting up aliases that actually run scripts so that it is easier to (a) code up your scripts and (b) do more complex work with error

How do you squash commits into one patch with git format-patch?

最后都变了- 提交于 2019-11-27 05:50:57
I've got eight commits on a branch that I'd like to email to some people who aren't git enlightened, yet. So far, everything I do either gives me 8 patch files, or starts giving me patch files for every commit in the branch's history, since the beginning of time. I used git rebase --interactive to squash the commits, but now everything I try gives me zillions of patches from the beginning of time. What am I doing wrong? git format-patch master HEAD # yields zillions of patches, even though there's # only one commit since master I'd recommend doing this on a throwaway branch as follows. If your

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

懵懂的女人 提交于 2019-11-27 03:36:33
问题 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

How to squash commits in git after they have been pushed?

守給你的承諾、 提交于 2019-11-26 13:54:42
This gives a good explanation of squashing multiple commits: http://git-scm.com/book/en/Git-Branching-Rebasing but it does not work for commits that have already been pushed. How do I squash the most recent few commits both in my local and remote repos? EDIT: When I do git rebase -i origin/master~4 master , keep the first one as pick , set the other three as squash , and then exit (via c-x c-c in emacs), I get: $ git rebase -i origin/master~4 master # Not currently on any branch. nothing to commit (working directory clean) Could not apply 2f40e2c... Revert "issue 4427: bpf device permission

Is there a way to squash a number of commits non-interactively?

 ̄綄美尐妖づ 提交于 2019-11-26 11:51:07
问题 I\'m trying to squash a range of commits - HEAD to HEAD~3. Is there a quick way to do this, or do I need to use rebase --interactive? 回答1: Make sure your working tree is clean, then git reset --soft HEAD~3 git commit -m 'new commit message' 回答2: I personally like wilhelmtell's solution: git reset --soft HEAD~3 git commit -m 'new commit message' However, I made an alias with some error checking so that you can do this: git squash 3 'my commit message' I recommend setting up aliases that

How do you squash commits into one patch with git format-patch?

醉酒当歌 提交于 2019-11-26 11:45:56
问题 I\'ve got eight commits on a branch that I\'d like to email to some people who aren\'t git enlightened, yet. So far, everything I do either gives me 8 patch files, or starts giving me patch files for every commit in the branch\'s history, since the beginning of time. I used git rebase --interactive to squash the commits, but now everything I try gives me zillions of patches from the beginning of time. What am I doing wrong? git format-patch master HEAD # yields zillions of patches, even

Squash the first two commits in Git? [duplicate]

梦想与她 提交于 2019-11-26 04:02:41
问题 This question already has an answer here: Combine the first two commits of a Git repository? 8 answers With git rebase --interactive <commit> you can squash any number of commits together into a single one. That\'s all great unless you want to squash commits into the initial commit. That seems impossible to do. Are there any ways to achieve it? Moderately related: In a related question, I managed to come up with a different approach to the need of squashing against the first commit, which is,

How to squash commits in git after they have been pushed?

拥有回忆 提交于 2019-11-26 03:46:29
问题 This gives a good explanation of squashing multiple commits: http://git-scm.com/book/en/Git-Branching-Rebasing but it does not work for commits that have already been pushed. How do I squash the most recent few commits both in my local and remote repos? EDIT: When I do git rebase -i origin/master~4 master , keep the first one as pick , set the other three as squash , and then exit (via c-x c-c in emacs), I get: $ git rebase -i origin/master~4 master # Not currently on any branch. nothing to

How to squash all git commits into one?

旧时模样 提交于 2019-11-26 03:21:53
问题 How do you squash your entire repository down to the first commit? I can rebase to the first commit, but that would leave me with 2 commits. Is there a way to reference the commit before the first one? 回答1: Perhaps the easiest way is to just create a new repository with current state of the working copy. If you want to keep all the commit messages you could first do git log > original.log and then edit that for your initial commit message in the new repository: rm -rf .git git init git add .