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
148
votes
7 answers

can't push to branch after rebase

We use git and have a master branch and developer branches. I need to add a new feature and then rebase the commits to master, then push master to CI server. The problem is that if I have conflicts during rebase I cannot push to my remote developer…
Matt
  • 2,341
  • 4
  • 20
  • 20
147
votes
8 answers

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

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?
Phillip
  • 5,366
  • 10
  • 43
  • 62
146
votes
5 answers

How to skip "Loose Object" popup when running 'git gui'

When I run 'git gui' I get a popup that says This repository currently has approximately 1500 loose objects. It then suggests compressing the database. I've done this before, and it reduces the loose objects to about 250, but that doesn't…
Michael Donohue
  • 11,776
  • 5
  • 31
  • 44
133
votes
4 answers

Git interactive rebase no commits to pick

I'm on master and I did rebase -i Got this: noop # Rebase c947bec..7e259d3 onto c947bec # # Commands: # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s,…
Lukasz
  • 3,135
  • 4
  • 20
  • 24
131
votes
2 answers

How to abort an interactive rebase if --abort doesn't work?

I've got myself into a muddle via an interactive rebase, and I now wish to abort it. (i.e. go back to the point before I was dropped into interactive rebase mode, in my case via git pull --rebase.) The way to do this seems to be via git rebase…
mjs
  • 63,493
  • 27
  • 91
  • 122
125
votes
6 answers

Git rebase: conflicts keep blocking progress

I have a git branch (called v4), that was made from master just yesterday. There were a couple of changes to master, that I want to get into v4. So, in v4, I tried to do a rebase from master, and one file keeps screwing things up: a one-line text…
Max Williams
  • 32,435
  • 31
  • 130
  • 197
121
votes
4 answers

Git rebase one branch on top of another branch

In my git repo, I have a Master branch. One of the remote devs created a branch Branch1 and had a bunch of commits on it. I branched from Branch1, creating a new branch called Branch2 (git checkout -b Branch2 Branch1) such that Branch2 head was on…
Beginner
  • 2,643
  • 9
  • 33
  • 51
113
votes
4 answers

Rebasing and what does one mean by rebasing pushed commits

It is often said that, you should not rebase commits that you have already pushed. What could be meaning of that?
Hemant Kumar
  • 1,988
  • 2
  • 13
  • 21
110
votes
6 answers

git pull *after* git rebase?

I have a feature branch, and a master branch. Master branch has evolved and I mean to have those updates to diverging as little as possible from master branch. So I git pull in both branches, git checkout feature/branch and finally git rebase…
ptpdlc
  • 2,373
  • 6
  • 22
  • 33
109
votes
4 answers

Git: Pulling a rebased branch

Let me describe my situation: Mr Blond and Mr Orange are working on branch A that branches out of the master branch on commit M1. Branch A has 2 commits: A1 and A2. M1 \ \ A1 - A2 Meanwhile, Mr Orange committed and pushed 2 more…
Itai Hanski
  • 8,540
  • 5
  • 45
  • 65
102
votes
4 answers

What does 'git remote add upstream' help achieve?

I was reading on: https://wiki.diasporafoundation.org/Git_workflow#Rebase_your_development_branch_on_the_latest_upstream Here is an extract: Your Repository Up to Date In order to get the latest updates from the development trunk do a one-time…
ben39
  • 2,427
  • 4
  • 20
  • 19
101
votes
6 answers

git rebase after previous git merge

I have the following situation: I created a clone(Y) from a main repository(X), because there were many people working on Y we didn't do any rebase but only merges. When we want to deliver(push) Y to X we would like to do a rebase in order to have…
INS
  • 10,594
  • 7
  • 58
  • 89
100
votes
4 answers

Rebasing a branch including all its children

I have the following Git repository topology: A-B-F (master) \ D (feature-a) \ / C (feature) \ E (feature-b) By rebasing feature branch I expected to rebase the whole subtree (including child branches): $ git rebase…
Tomasz Nurkiewicz
  • 334,321
  • 69
  • 703
  • 674
92
votes
4 answers

Edit a merge commit with git rebase

In Git when I have commits eg. A - B - C and I want to edit the B commit, I use git rebase -i , in the list I write edit command in front of B commit, git rebase stops right after B commit so I can fix anything I want using git…
vasekch
  • 1,207
  • 1
  • 10
  • 9
91
votes
3 answers

How do I recover/resynchronise after someone pushes a rebase or a reset to a published branch?

We have all heard that one should never rebase published work, that it’s dangerous, etc. However, I have not seen any recipes posted for how to deal with the situation in case a rebase is published. Now, do note that this is only really feasible if…
Aristotle Pagaltzis
  • 112,955
  • 23
  • 98
  • 97