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
59
votes
4 answers

How to move some changeset to a new branch in mercurial

I want to move a changeset from one branch to another. Basically, I currently have: A -> B -> C -> D # default branch And I want: A # default branch \-> B -> C -> D # some_new_branch Where some_new_branch does not exist yet. I am used to git, so…
David Cournapeau
  • 78,318
  • 8
  • 63
  • 70
56
votes
2 answers

Error with git rebase ("could not apply...")

I'm the administrator of the GitHub repository https://github.com/plison/opendial. I would like to reduce the number of commits on the repository, since the repository already has a few thousand commits, many of whom are minor debugging changes that…
Pierre Lison
  • 678
  • 1
  • 5
  • 7
54
votes
7 answers

How to back up private branches in git

I have a local branch for day-to-day dev work in git. My workflow is: Do stuff on local_branch, commit Fetch origin/master Rebase local_branch to catch up with new stuff from origin/master It all works fine, however most of the recommendations I…
Art
  • 23,747
  • 29
  • 89
  • 101
54
votes
3 answers

Git: difference "git rebase origin/branch" VS "git rebase origin branch"

Does anyone know what is the difference? Seems to me, it is the same. But when I run it, it didn't do the same thing: git rebase origin/branch - ok rebases from remote branch git rebase origin branch - makes conflicts
Adam
  • 1,779
  • 2
  • 15
  • 14
53
votes
3 answers

git apply changes from one commit onto another branch

I want to do something similar to git rebase but without collapsing parallel commits. Let's say I have the following commits: B (bar) / A-C-D (foo) Now I want to take the changes that D introduced to C in branch foo, and apply them to B in…
juniper-
  • 6,262
  • 10
  • 37
  • 65
49
votes
6 answers

How to Subversion rebase?

I find this way easier to merge branches and less conflicts: Copy trunk to a new branch, merge it with feature branch/s. When things done, merge the new branch back to the trunk. This technique is quite like the mercurial and git rebasing. I used…
bo bo
  • 824
  • 1
  • 8
  • 11
48
votes
3 answers

Git squash all commits in branch without conflicting

A common development workflow for us is to checkout branch b, commit a bunch to it, then squash all those commits into one (still on b). However, during the rebase -i process to squash all the commits, there are frequently conflicts at multiple…
Andy Ray
  • 30,372
  • 14
  • 101
  • 138
45
votes
3 answers

Git interactive rebase without opening the editor

Git allows certain commands to create or modify commits without opening the editor first, for example: git commit --amend --no-edit git commit --fixup=HEAD^ I have set rebase.autosquash to true, so that the todo list for an interactive rebase is…
friederbluemle
  • 33,549
  • 14
  • 108
  • 109
45
votes
4 answers

How to properly rebase in SourceTree?

SourceTree 1.6.4.0 on Windows 7. Let's say the following is my starting point: C <- master / - A - B <- topic I want to rebase topic onto master. My goal is to have: C - A - B ^ ^ master topic but I end up with: I can then do git…
Patrick
  • 605
  • 1
  • 6
  • 8
44
votes
1 answer

Git Workflows: Rebasing Published/Shared Branches

Our team at work has enthusiastically adopted a rebase workflow, but we might have gotten a little carried away, which is the point of this question: you be the judge. Using pull --rebase is a no-brainer to me now. However, we also have large…
Ethan Brown
  • 26,892
  • 4
  • 80
  • 92
44
votes
5 answers

Stuck in a git rebase ... how to reset

I am part way through a git rebase and I am stuck. I can't remember exactly what happened but I was using a UI and deleted a checked-out branch and things just seemed to go blank. I restarted and managed to do a bit of other work creating and…
Simon Woods
  • 905
  • 1
  • 6
  • 13
43
votes
4 answers

Is it possible to do a Git Pull --rebase with Visual Studio git tools (and can it be set by default)

First, as the title says, is it even possible in a single step (i.e. not fetch then rebase), to do a pull --rebase? Second, is a setting in Visual Studio to force the built-in Team Explorer git tools to always do a pull --rebase rather than a…
LocalPCGuy
  • 6,006
  • 2
  • 32
  • 28
42
votes
4 answers

When will `git pull --rebase` get me in to trouble?

I understand that when I use git pull --rebase, git will re-write history and move my local commits to occur after all of the commits in the branch I just pulled from. What I don't understand is how this would ever be a bad thing. People talk…
Gabe Hollombe
  • 7,847
  • 4
  • 39
  • 44
41
votes
2 answers

How do I use Git's interactive rebase with a local-only repository (no remote / origin)?

I use git as a local source control system mostly for history and diff tracking. I still want to use rebase to do fixup / squash on WIP commits that I will make periodically. When I try to do git rebase -i though, I get the following: There is no…
mcw
  • 3,500
  • 1
  • 31
  • 33
40
votes
2 answers

Rebasing a local branch from develop

I want to rebase a feature branch from develop. I am using PhpStorm Git integration and I have 2 different develop branches: refs/remotes/origin/develop refs/heads/develop In order to do not mess up things, which one do I have to choose to rebase?
Kaiser Soze
  • 1,362
  • 3
  • 14
  • 31