version control - Restore moved file's history in Git -


if file has had it's name , content changed, possible mark move after commit has taken place?

e.g.

  1. file1.txt changed file2.txt , content changed.
  2. git commit
  3. git thinks file1.txt has been delete , file2.txt unrelated, new file.

is there way flag rename after commit has happened?

no, isn't, because git doesn't rename tracking... rename detection
(based on how similar contents , name of files).

this means

  • git log --follow file2.txt follow file history through rename (note: unfortunately not work correctly, --follow bit of hack),
  • git blame -c -c file2.txt follow line-wise file history across file renames, content copying , moving across files , inside file
  • git show -c show there file rename (you can configure git rename , optionally copy detection when displaying diffs).

hth


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -