Move file between git branches

For my own memory more than anything else:

  1. git rebase -i <the last commit before the file appeared>
  2. edit those commits where the file appears with other files (Highlight using gitk), then for each of those:
    1. git reset HEAD^
    2. Create one commit for the file, and another for the rest.
    3. git rebase --continue

Source: Splitting commits

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s