Git commit squashing (rebase -i): how do commits actually work?
I don't quite understand how the commits are squashed with git rebase -i. There is one thing I was left wondering:
If my rebase -i produces this list:
pick A Last commit
pick B Commit
pick C Some other commit
Should I squash commits A and B or B and C? Problem is git said in this case that it would rebase D..A onto D (D being the last commit before this) rather than C..A onto C which would make sense to me. D is not shown at all, so why word it like that?
Suppose I have a commit history like this master | |A| -> |B| -> |E| | |C| -> |D| | hotfix Assume that commit E and D have conflicts. Now, according the docs, after a rebase $> git chec
As far as I know, git squash is quite useful when there is a bunch of commits in one pull request. It can help to combine commits and then reduce the number of commits. For example, here is what some
Is there any easy way to calculate the number of lines changed between two commits in git? I know I can do a git diff, and count the lines, but this seems tedious. I'd also like to know how I can do t
I would like to change the commit message one of my previous commits. I guess I can return to the commit I would like to amend with git reset <the commit id>, change the commit with git commi
I cloned a repository and want to switch between to a commit to test my plugin against the core.
when I do git rebase master I get conflict sometimes. And sometimes it becomes very difficult to track down an issue even with error messages. It would be a real help if I could find out which commit
I'm not really familiar with how git works. I pushed a commit by mistake and want to revert it. I did a git reset --hard HEAD~1 and now the project is reverted on my machine, but not on github. If I
I think I squashed the last 40 commits using rebase. I was following this guide to make sure I didn't do anything stupid - http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html Th
I have been reading about git rebase and the advantage of using a rebase workflow instead of a merge workflow. (I haven't actually been in the situations below as I am new to git) I have read that one
As Git user I regular come across the situation, that I need to rework one or more commits in a way which do not fit into --amend or rebase -iwith fixup commits. Typically I would do something like gi
I am interested in how RVM and RBEnv actually work. Obviously they swap between different versions of Ruby and gemsets, but how is this achieved? I had assumed they were simply updating symlinks, but
A bunch of questions ask how to rewrite (rebase) some commits so that they appear on a branch, but these all seem to assume that rebase is actually necessary, i.e. that the commits wanted for the bran
I am using a bare git repository on a server for backup, and push local changes there with 'git push' after doing 'git commit' locally. 'git status' tells me # On branch master # Your branch is ahead
When I encounter a merge conflict using git rebase, how can I identify the source of the conflict in terms of commits, rather than just file differences? I already know how to make (basic) use of git
When using interactive rebase, I don't understand the difference between Fixup-ing a commit into the previous one, and simply deleting all the other commits from the list. As far as I can tell, since
I've been doing some reading on how both the git merge and git rebase operations work, and I think I have a very basic understanding of the differences. I've seen the diagrams :-) Despite that, I'm st
I have a pair of commits that should really be just one. If I was using git, I would use: git rebase -i <some-commit-before> and then squash them. Can I do that in mercurial? If so, how?
The git rebase command shows a list of some commit ids to pick operations for them; the problem is that all history messages are the same (empty) and I don't know how they are correlated to SHA1 IDs
I have asked Git to perform a commit from within git bash, It has brought up VI as it always does. I now wish to cancel the commit, how do I prevent proceeding with the commit from this point?
My problem: cygwin git doesn't seem to correctly prompt for credentials when using https:// URLs, so I used username and password in the URL. Unfortunately when I did a get pull it auto-commited a m
My local master branch and origin/master branch diverted by just 1 commit, and I want to rebase my master on to origin/master, so I did this: git rebase origin/master This give me a conflict and I s
I git the purpose of rebase. It makes sense to me. Basically i I have a feature branch I'm working on and I'm ready to put it into the master branch I would do a rebase to squash all of my commits int
I have a bunch of commits, say A, B, C, D, and I want to keep B, C, and D, and make a commit that is (BCD)⁻¹. What's the easiest way to do this, if I have many commits that I want to undo at the same
I can pull changes using git pull, but it merges my local commits. Is there a git rebase equivalent with which I can pull in remote changes?
Crap! About a week ago, I was rebasing some commits while trying to clean up my repository, and apparently I didn't actually finish it. Today, a week and several commits later, I went to rebase to reo
I don't really understand what happens if I check out an old commit, do some modifications, and commit using git commit --amend. Will that change automatically propagate to future commits? How does i
I'm using git, and made a small commit followed by a large one. I decided to use git rebase to squash the two commits together before pushing them. (I've never done this before.) So I did: git rebase
Summary What is the fastest way of finding, in the current branch, the most recent commit also contained in any other branches? Bonus: Can the technique allow for any other branches in the question
I am rebasing in git and am encountering many conflicts. I address each one and do git rebase --continue, only to be met with the next conflict. How can I see how close I am to successfully completing
I understand that the correct way of amending an GIT old commit is to use rebase --interactive, but just to get clear on the concepts, I would like to understand what happens when I do git checkout
I have a post-commit hook that does stuff un ruby. It works very well but in some cases I would like to skip the code execution when I do a rebase or when I do a commit --amend. Does someone have an i
Say I have 100 commits in my branch that I've been working on for 3 weeks. Occasionally (every day, really) I pull from origin/master and merge it into my branch. How could I (easily) go about squashi
I want to do an interactive rebase so I: git rebase -i HEAD~5, but I'm getting more than five commits. Why could it be?
On question: How can I remove a commit on github? I can't to use same solution on my project. I want to go to commit 30735f3d by command: git rebase -i HEAD~2 * 823da1cf7976466da40a5720191d09b080e04
I just did a git pull --rebase origin master and there was a conflict. Firstly, this conflict was in a file that I hadnt touched, and was about 10 commits back. Why does this happen? I then accidently
I came across the following problem: During git rebase one of automatically resolved commits has an error, i.e. as a result of automatic resolution, a function declaration was introduced for the secon
I have a bunch of commits on my local repository which are thematically similar. I'd like to combine them into a single commit before pushing up to a remote. How do I do it? I think rebase does this,
I have a doubt related to creating patches and rebase them into master branch. For example: I'm working in a separated branch from master and I generated 5 commits of change. So, I want to send this c
I changed an image file in git and it was 2 commits ago. How do I go back to 2 previous commits ago? What is the easiest method of doing this file revert via the command line with the least amount of
How do I include a defect number when doing a mercurial commit? The way that I'm currently doing it is to precede the commit message with the defect number so that QA can find the commits that relate
What is the cost for each commit in git? For example, if I commit changes A and B at once versus making separate commits for each, how much more (or less) space is used?
I have the following scenario: Branch Feature A - X (HEAD) Branch Master (Have some new stuff since branch creation) A - B - C If I do git merge (on top of branch feature) I have: A - X - B - C Is
In light of this: Git - combining multiple commits before pushing suppose I have this rebase: pick 16b5fcc msg1 pick c964dea msg3 pick 06cf8ee msg1 pick 396b4a3 msg2 pick 9be7fdb msg3 pick 7dba9cb ms
I have some garbage commits in my git repositry. These have been created by e.g. the git gui when changing the latest commit again and accidently creating additional commits. Now I have some commits l
This question already has an answer here: Git rebase: Combine non-subsequent commits 1 answer Suppose I have the following history in my repo: git log --oneline <3rd sha1> Third commit. &
I'm new to Git, I do development on a local host and do frequent commits, however, I don't want all this commit history to be shown when I push to origin. How to I achieve that?
My current git history looks like this: develop: A -- B -- C \ feature1: D -- E \ feature2: G -- H -- I But, I would prefer this, instead: feature2: G' -- H' -- I' / develop: A -- B -- C \ feature1:
I wanted to reword my commit messages. I used git rebase --interactive, and used reword to alter commit messages. My expectations were that my tree will remain exactly the same, but with different com
Let's say I have these commits in chronological order: a b c Now, I want to get rid of b but keep c, so that I have: a c How do I do this? (there are no conflicts between b and c)
I wrote a node module that uses git to make a bunch of commits from time to time. Considering the commits are better if grouped into one single commit, I'd like to use git rebase -i to squash them i