Questions tagged [rebase]

Changing the starting point of a branch in a Version Control System.

An operation in a version control system or a special way of creating a shared library. (In order of the question counts in Stack Overflow)


Version Control Systems

In some source control system (also known as Version Control Systems o ) that support a rebase is one of the ways of integrating the changes of one branch into another by changing the "father" or starting point of a branch.

Git

See .

Darcs

Support it's still in an early status (March 2013)

Mercurial

There is a Rebase Extension for mercurial as noted in "How to do a rebase like git's rebase"

Subversion

There is no rebase support but using merge --reintegrate might be considered as a similar operation as mentioned in "Subversion rebase?" and "Subversion Branch Reintegration v1.5"


Shared Libraries

Creating a shared library to avoid conflicts with other libraries in the usage of virtual memory. (Wikipedia)

2189 questions
84
votes
3 answers

How to rebase a branch off a rebased branch?

So my history looks like this: o---o---o---o master \ o---o---o A \ o B So, to explain: I have branch A which was started from master I have branch B (with only 1 commit) which was started from A What…
Radu Murzea
  • 10,724
  • 10
  • 47
  • 69
84
votes
2 answers

Using Source Tree, rebase with conflict, rebase doesn't work after conflict resovled

I'm using SourceTree as my git tool on Windows. I have a main branch and a feature branch and I can't get SourceTree to perform a rebase when I have a conflict. main looks like: c1 -> c2 -> c4 -> c5 feature looks like: c1-> c2 -> c3 I want to…
user4007604
79
votes
6 answers

How to prevent many git conflicts when rebasing many commits?

Story: in the middle of a project my colleague created a new branch from master and started doing her heavy re-factoring work. I created my branch from master and started doing new stuff on the page. We are committing regularly, but only I can…
equivalent8
  • 13,754
  • 8
  • 81
  • 109
76
votes
5 answers

How to rebase many branches (with the same base commit) at once?

I have a master branch in my project, that I use to pull changes from other people. From that, I usually have several topic branches on which I'm currently working. My question is: Is there a way for me to pull new changes into my master and then…
malvim
  • 1,194
  • 1
  • 8
  • 17
74
votes
5 answers

Rebase a branch without checking it out

So I'm working on a project that sometimes has long build times, and the build is clobbered very often. If I have an older branch with some work going on (which has been committed, but is based on an older parent), running git checkout oldbranch…
Manishearth
  • 14,882
  • 8
  • 59
  • 76
71
votes
6 answers

Git rebase will not continue after a delete/modify conflict

I'm in the middle of a rebase of my master to a stage branch git checkout stage git rebase master At some time I deleted two files then modified the two files according to GIT. warning: too many files, skipping inexact rename detection CONFLICT…
Clutch
  • 7,404
  • 11
  • 45
  • 56
71
votes
8 answers

Can I rebase a Git branch without modifying my working copy?

Suppose I have my "master" branch checked out. I've committed some production changes to "master", and now I want to rebase my "experimental" branch onto the latest master. But, I want to do this without modifying any files in my working copy.…
Joe White
  • 94,807
  • 60
  • 220
  • 330
70
votes
2 answers

git rebase and git push: non-fast forward, why use?

I have a branch that should be available to other contributors and that should constantly stay up to date with the master. Unfortunately, every time I do 'git rebase' and then try to push, it results in 'non-fast forward' message and abortion of…
orion3
  • 9,797
  • 14
  • 67
  • 93
67
votes
4 answers

How to rebase one Git repository onto another one?

I had one Git repository (A) which contains the development of a project until a certain point. Then I lost the USB stick this repo A was on. Luckily I had a backup of the latest commit, so I could create a new repository (B) later where I imported…
kroimon
  • 2,062
  • 3
  • 19
  • 23
67
votes
4 answers

Rebasing in smartgit "git-am is in progress"

I will try to explain the problem that I have. I have used the rebase option via git bash many times. Now I have SmartGit and don’t know why rebase is not correct. Step 1: Step 2: Step 3: The result is that HEAD detaches.
Ark
  • 1,343
  • 2
  • 12
  • 26
65
votes
2 answers

Git - Moving Pushed Commits to a Different Branch

My boss decided recently to try out an outsourcing group "for increased capacity" as we modify an existing application to add new features. Despite my concern that the group he chose didn't seem to communicate well and wasn't asking enough questions…
Anthony Compton
  • 5,271
  • 3
  • 29
  • 38
62
votes
3 answers

How to rebase after squashing commits in the original branch?

I have A--B--C master \ D branch0 Then I squash B and C into B'. How do I rebase branch0 such that it looks like this: A--B' master \ D branch0
erensezener
  • 847
  • 1
  • 7
  • 10
62
votes
6 answers

git rebase interactive: squash merge commits together

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 ---…
Mildred
  • 3,887
  • 4
  • 36
  • 44
61
votes
5 answers

Fast-forward merge is not possible. To merge this request, first rebase locally

Recently, I have created newbranch and created a merge request to Master branch. Before TeamLead accept merge request into Master branch another team member was committed another fix to the same branch(newbranch). After that I committed my local…
SanjX
  • 957
  • 1
  • 8
  • 12
61
votes
2 answers

Git: First rewinding head to replay

I am getting this message: First, rewinding head to replay your work on top of it... each time I do a git pull --rebase origin , however I would like to discard all my work that may be replayed on top of it.. Basically I would like to…
Rollerball
  • 12,618
  • 23
  • 92
  • 161