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)

1856 questions
122
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
  • 30,785
  • 29
  • 115
  • 186
117
votes
7 answers

Git: "Cannot 'squash' without a previous commit" error while rebase

I have the following in the to-do text of git rebase -i HEAD~2: pick 56bcce7 Closes #2774 pick e43ceba Lint.py: Replace deprecated link # Rebase 684f917..e43ceba onto 684f917 (2 command(s)) # ... Now, when I try to squash the first one(56bcce7)…
Dawny33
  • 8,545
  • 11
  • 65
  • 121
113
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
  • 2,913
  • 4
  • 17
  • 24
111
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,958
  • 2
  • 13
  • 21
111
votes
3 answers

How can I combine two commits into one commit?

I have a branch 'firstproject' with 2 commits. I want to get rid of these commits and make them appear as a single commit. The command git merge --squash sounds promising, but when I run git merge --squash my terminal just brings up options for the…
Don P
  • 49,839
  • 95
  • 259
  • 394
101
votes
13 answers

Git push rejected "non-fast-forward"

I am fairly new to git, yet currently using it to manage our code in a team environment. I had some rebasing issues, and I fixed them using: git checkout --ours filename.txt git add filename.txt git rebase --continue Now I wish to push my changes,…
Frankline
  • 37,672
  • 8
  • 40
  • 71
93
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
  • 311,858
  • 65
  • 665
  • 652
88
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
  • 101,052
  • 21
  • 94
  • 96
82
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,167
  • 2
  • 17
  • 19
82
votes
5 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
  • 9,798
  • 4
  • 52
  • 88
74
votes
4 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…
tisek
  • 1,763
  • 2
  • 17
  • 28
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…
snitko
  • 9,407
  • 10
  • 59
  • 89
67
votes
4 answers

Git: 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,104
  • 1
  • 8
  • 17
67
votes
3 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
  • 7,922
  • 4
  • 39
  • 62
65
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
  • 1,975
  • 8
  • 29
  • 45