version control - New SDK drop... how to instruct git that certain files are moved? -


i've been working on sdk i've received new code drop for.

when starting on project created import branch on committed sdk , merged master branch first commit.

but there's new version of sdk , noticed lot has changed in directory structure. quite lot files have been moved subdirectories improve structuring of codebase guess.

so want have new commit on import branch merging master easier don't know how instruct git files have been moved.

git mv file_a dir_a/file_a 

...doesn't work because target file exists. tried:

git mv -f file_a dir_a/file_a 

isn't want either since target location overwritten content of old version.

i tried gitmoving first resemble new directory structure , copying over. git still sees remove of old file , addition of new file.

so way proceed here? tips/pointers welcome!

git not track moves can't directly. git tries identify moved files on fly looking see if file added lot file deleted. git rm old files , git add new files , see git status says. can modify behaviour of rename detection in git log, here's copy of relevant section git log.

-m[<n>], --find-renames[=<n>]    if generating diffs, detect , report renames each commit. following    files across renames while traversing history, see --follow. if n    specified, threshold on similarity index (i.e. amount of    addition/deletions compared file’s size). example, -m90% means git    should consider delete/add pair rename if more 90% of file    hasn’t changed. without % sign, number read fraction,    decimal point before it. i.e., -m5 becomes 0.5, , same    -m50%. similarly, -m05 same -m5%. limit detection exact    renames, use -m100%. 

Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -