How to inject a commit between some two arbitrary commits in the past?
Suppose I have the following commit history on my local-only branch: A — B — C How do I insert a new commit between A and B? 7 Answers 7
Suppose I have the following commit history on my local-only branch: A — B — C How do I insert a new commit between A and B? 7 Answers 7
We have a Git repository with over 400 commits, the first couple dozen of which were a lot of trial-and-error. We want to clean up these commits by squashing many down into a single commit. Naturally, git-rebase seems the way to go. My problem is that it ends up with merge conflicts, and these conflicts … Read more
Would it make sense to perform git rebase while preserving the commit timestamps? I believe a consequence would be that the new branch will not necessarily have commit dates chronologically. Is that theoretically possible at all? (e.g. using plumbing commands; just curious here) If it is theoretically possible, then is it possible in practice with … Read more
When I run: git status I see this: rebase in progress; onto 9c168a5 You are currently rebasing branch ‘master’ on ‘9c168a5′. (all conflicts fixed: run “git rebase –continue”) nothing to commit, working directory clean When I do: ls `git rev-parse –git-dir` | grep rebase || echo no rebase I see: rebase-apply I can’t commit to … Read more
Suppose you have a history containing the three commits A, B and C: A-B-C I would like to combine the two commits A and B to one commit AB: AB-C I tried git rebase -i A which opens up my editor with the following contents: pick e97a17b B pick asd314f C I change this to … Read more
I’d like to rebase to a specific commit, not to a HEAD of the other branch: A — B — C master \ \– D topic to A — B — C master \ \– D topic instead of A — B — C master \ \– D topic How can I achieve that? 11 … Read more
Take the following case: I have some work in a topic branch and now I’m ready to merge back to master: * eb3b733 3 [master] [origin/master] | * b62cae6 2 [topic] |/ * 38abeae 1 I perform the merge from master, resolve the conflicts and now I have: * 8101fe3 Merge branch ‘topic’ [master] |\ … Read more
I have noticed that the two blocks of following git commands have different behaviours and I don’t understand why. I have an A and a B branches that diverge with one commit —COMMIT— (A) \ — (B) I want to rebase B branch on the lastest A (and have the commit on the B branch) … Read more
I’m a bit new to the whole rebasing feature within git. Let’s say that I made the following commits: A -> B -> C -> D Afterwards, I realize that D contains a fix which depends on some new code added in A, and that these commits belong together. How do I squash A & … Read more
I’m having a problem with my git repo. For the last couple of days whenever I do a push to the server I get this message: “Auto packing the repository for optimum performance”, and it does not seem to go away and return the shell. I also tried checking out to a new branch and … Read more