Menu

1 / 6

Rewriting Git History with Interactive Rebase

DEV Community: github·murat cabuk·about 23 hours ago
#H9maWchc
#devtogithub#technology#devto#dev#result
Reading 0:00
15s threshold

Hello friends,

In this third article of our Git in Depth series, we'll try to learn and understand the topic of "interactive rebase".

As you can tell from the title, interactive rebase is used to change/rewrite our git history.

However, we need to keep the following warning in mind. Never rebase shared commits. Changes made to the past, especially on remote repos, can be very exhausting.

But again, for example, if a piece of information that shouldn't have been shared was written to the history, it may need to be deleted. For this, the best method is actually to delete a specific file or text from the entire history with the BFG tool. For details, you can check out this link.

The git blame command gives all the changes made in a file and their commit information.

git blame DOSYA_ADI

Enter fullscreen mode

Exit fullscreen mode

Important Note: in interactive rebase, the commit chosen as the base isn't included in the rebase operation.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.