threads / discuss / 51757

How to split file with its history?

Subject: How to split file with its history?

## tl;dr

3 messages between Aug 27, 2019 and Aug 27, 2019.

replies: 2people: 2as markdown or json

Konstantin· Aug 27, 2019, 10:10 UTC · lore

currently we have one code file with deep history. As code file grown it is necessary to split it. but this action will drop history for the new extracted file. how can i split one big code file to small files and save its history for the "blame" action?

-- 
Best regards,
Konstantin K
SZEDER Gábor· Aug 27, 2019, 10:36 UTC · re: Konstantin · lore

Re: How to split file with its history?

On Tue, Aug 27, 2019 at 01:10:02PM +0300, Konstantin wrote:
Show 5 quoted lines
> currently we have one code file with deep history.
> As code file grown it is necessary to split it.
> but this action will drop history for the new extracted file.
> how can i split one big code file to small files and save its history
> for the "blame" action?
'git blame -C' can detect lines moved between files.
https://git-scm.com/docs/git-blame#Documentation/git-blame.txt--Cltnumgt
Konstantin· Aug 27, 2019, 10:59 UTC · re: SZEDER Gábor · lore

Re: How to split file with its history?

thank you. your answer is pretty complete.
On Tue, Aug 27, 2019 at 1:36 PM SZEDER Gábor <szeder.dev@gmail.com> wrote:
Show 12 quoted lines
>
> On Tue, Aug 27, 2019 at 01:10:02PM +0300, Konstantin wrote:
> > currently we have one code file with deep history.
> > As code file grown it is necessary to split it.
> > but this action will drop history for the new extracted file.
> > how can i split one big code file to small files and save its history
> > for the "blame" action?
>
> 'git blame -C' can detect lines moved between files.
>
> https://git-scm.com/docs/git-blame#Documentation/git-blame.txt--Cltnumgt
>
-- 
Best regards, Konstantin Kosukhin

← back to recent threads