Search icon
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Git Essentials - Second Edition

You're reading from  Git Essentials - Second Edition

Product type Book
Published in Nov 2017
Publisher Packt
ISBN-13 9781787120723
Pages 238 pages
Edition 2nd Edition
Languages
Author (1):
Ferdinando Santacroce Ferdinando Santacroce
Profile icon Ferdinando Santacroce

Rebasing

Now I want to tell you something about the git rebase command; a rebase is a common term while using a versioning system, and even in Git this is a hot topic.

Basically, with git rebase you rewrite history; with this statement, I mean you can use rebase command to achieve the following:

  • Combine two or more commits into a new one
  • Discard a previous commit you did
  • Change the starting point of a branch, split it, and much more

Reassembling commits

One of the widest uses of the git rebase command is for reordering or combining commits. For this first approach, imagine you have to combine two different commits.

Suppose we erroneously added half a grape in the shoppingList.txt file, then the other half, but at the end...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime}