Tag: git rebase

git rebase issue reordering

I’m having an issue while rebasing git commits. The problem is: pick A pick B <- mine pick C pick D pick E <- mine pick F <- mine I want to squash all my commits into one. I planned to do something like: pick A pick C pick D pick B <- mine squash […]

Will I run into trouble with this Git rebase workflow?

I’ve just learned about rebase, and I’ve been strongly warned not to rebase commits after they have been pushed to a remote. I want to make sure I’m not going to explode my repository Example commit history foo W—X—Y / \ master A—B—C—D—E—Z—F—G Here, all commits on the master branch will likely have been pushed […]

git svn rebase always rebases master?

I’m trying to create a git repository that has several branches which each track a different svn repository. I want master to be a git-only branch, not one of the svn branches. Here’s my initial setup: $ mkdir repo $ cd repo $ git init $ touch README $ git add . $ git commit […]

Git – How to verify that a git-rebase –interactive did not change the final state of the project

I often use git rebase –interactive for cleaning up history. It happens there are mergeconflicts, or even if there are no conflicts, there are still merges. I’m always a bit scared that something has changed even though I only changed the order of the commits, squashed them etc. I used to keep a backup copy […]

Interactive rebase: modify a recent commit among a bunch of –no-ff merges

The goal I want to modify a recent commit, using rebase. The magic command is git rebase -i Let’s say you’re trying to delete the commit-in-question First, find out how far back that commit is (approximately). Then do: git rebase -i HEAD~10 –Source: Greg Hewgill’s answer to a less complicated git question The problem That […]

Git History and Rebase issue

I do a commit to my local repo, then I pushed it to origin after that I amended the commit and tried to push it but I got an error saying that I need to pull from origin, I made that and a conflict happened I fixed it and committed the change to local and […]

How does one copy commits without producing different SHA1s?

As much as I’ve tried to avoid it, I have to maintain three master-equivalient branches with minor changes in each one. I’ve been reading about git and using it for a couple of years, so I’m familiar with the following conventional wisdom: Don’t merge unless it is meaningful. Use rebase instead. If you just need […]

Getting into rebase -> merge cycle with Git

I have a branch mainline tracking remote branch origin/mainline My local branch went out of sync with the remote branch so I did a git pull and now when i do a git status I get: Your branch is ahead of ‘origin/mainline’ by 2 commits. Now i want to squansh these into a single commit […]

Rebase without changing content

Is there a simple option to git rebase that says: “Rewrite this history, automatically resolving all conflicts in such a way that the content of HEAD after the rebase will remain the same as it is now”? I have a feature branch and I have merged in master; essentially I’d like to redo that as […]

git: changing an old commit message without creating conflicts

I want to change a pretty old commit message using: git rebase -i sha1-of-commit^ That’s nice, I do git commit –amend and edit the message, but things get bad when I do: git rebase –continue I encounter multiple conflicts but don’t understand why as the whole conflict resolution has obviously already been done in the […]

Git Baby is a git and github fan, let's start git clone.