Skip to Main Content
Pragmatic Guide to Git
book

Pragmatic Guide to Git

by Travis Swicegood
November 2010
Beginner content levelBeginner
160 pages
2h 50m
English
Pragmatic Bookshelf
Content preview from Pragmatic Guide to Git
29 Moving Branches

Sometimes you need to move branches around to reorganize them. For example, you have a branch where you’re working on a future version of your software. During the rewrite, your team realizes that the better-widget feature can be released as a minor version of your software instead of being part of the next major version. This is where you can move a branch to make your repository more sane.

You use git rebase --onto to move branches. Like a normal git rebase, Git replays the commits from one branch against another. The difference is that Git takes the branch you’re rebasing, and instead of replaying it against another branch, it moves it to an entirely different one.

The syntax is more verbose than a simple git rebase ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Pragmatic Version Control Using Git

Pragmatic Version Control Using Git

Travis Swicegood
Git Version Control Cookbook - Second Edition

Git Version Control Cookbook - Second Edition

Kenneth Geisshirt, Emanuele Zattin(EUR), Aske Olsson, Rasmus Voss
Git for Programmers

Git for Programmers

Jesse Liberty

Publisher Resources

ISBN: 9781680500028Errata