Git interactive rebase no commits to pick

Question:

I’m on master and I did rebase -i <my_branch>

Got this:

I would like to pick some commits not all as some of them are not welcome.
Also how do you work when you want to keep some files or changes always ‘local’ to some branch? Is there some helper like .gitignore?

Answer:

Like a non-interactive rebase, you have to rebase onto a particular commit.

With a non-interactive rebase, if you supply a direct ancestor of the current commit then you aren’t changing anything; with an interactive rebase you can edit commits after the commit that you are rebasing onto, even if the commit is a direct ancestor of your current commit but you do have to specify this commit that you want to edit onwards from.

I don’t know the details of your situation but you might want something like this:

or

Leave a Reply