Skip to content

Instantly share code, notes, and snippets.

@kitsuyui
Last active May 21, 2016 14:30
Show Gist options
  • Save kitsuyui/a3b3eb31b8b065690c020ba9c4ab32a3 to your computer and use it in GitHub Desktop.
Save kitsuyui/a3b3eb31b8b065690c020ba9c4ab32a3 to your computer and use it in GitHub Desktop.
git diff で Similarity 50% 未満の変更を rename として見るには ref: http://qiita.com/kitsuyui/items/3390fda2c87aa699c75b
$ man git-diff
$ git diff -M[パーセンテージ]
$ seq 3 6
3
4
5
6
$ git add samplefile
$ git commit -m 'first-commit'
$ git rm samplefile
$ git add samplefile2
$ git commit -m 'second-commit'
$ git diff HEAD^
diff --git a/samplefile b/samplefile
deleted file mode 100644
index f00c965..0000000
--- a/samplefile
+++ /dev/null
@@ -1,10 +0,0 @@
-1
-2
-3
-4
-5
-6
-7
-8
-9
-10
diff --git a/samplefile2 b/samplefile2
new file mode 100644
index 0000000..8a1218a
--- /dev/null
+++ b/samplefile2
@@ -0,0 +1,5 @@
+1
+2
+3
+4
+5
$ git diff -M40 HEAD^
diff --git a/samplefile b/samplefile2
similarity index 47%
rename from samplefile
rename to samplefile2
index f00c965..8a1218a 100644
--- a/samplefile
+++ b/samplefile2
@@ -3,8 +3,3 @@
3
4
5
-6
-7
-8
-9
-10
1
2
3
4
5
6
7
8
9
10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment