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 for Programmers

You're reading from  Git for Programmers

Product type Book
Published in Jun 2021
Publisher Packt
ISBN-13 9781801075732
Pages 264 pages
Edition 1st Edition
Languages
Author (1):
Jesse Liberty Jesse Liberty
Profile icon Jesse Liberty

Table of Contents (16) Chapters

Preface 1. Introduction 2. Creating Your Repository 3. Branching, Places, and GUIs 4. Merging, Pull Requests, and Handling Merge Conflicts 5. Rebasing, Amend, and Cherry-Picking 6. Interactive Rebasing 7. Workflow, Notes, and Tags 8. Aliases 9. Using the Log 10. Important Git Commands and Metadata 11. Finding a Broken Commit: Bisect and Blame 12. Fixing Mistakes 13. Next Steps
14. Other Books You May Enjoy
15. Index

Rebasing, Amend, and Cherry-Picking

If you say "rebasing" to most novice Git programmers, they burst into tears and run screaming from the room. But the truth is that this is only because of how it is explained in so many books and magazines, where rebasing is (correctly but confusingly) shown with diagrams of commits being copied and moved along with dense and technical text.

In truth, rebasing is not hard to understand, and it is not hard to do if you understand what it is for. In this chapter, we will review rebasing without fear.

Rebasing is a command that allows you to take a feature branch and place it on the tip of another branch. We'll discuss how, and more importantly why, you would do this.

Amending is a quick command that allows you to modify the most recent commit. You can use this to add a file you forgot to put in the commit or to fix up a botched message.

Cherry-picking is the ability to take one or more commits from a branch and apply...

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 $15.99/month. Cancel anytime}