Last active
August 29, 2015 14:06
-
-
Save kentfredric/10e93e9aac875e9edb93 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir gittest | |
cd gittest/ | |
git init | |
# Initialized empty Git repository in /tmp/gittest/.git/ | |
for i in $(seq 0 10); do echo $i >> orig; done | |
git add orig | |
git commit -m 'add orig' | |
# [master (root-commit) 284a05c] add orig | |
# 1 file changed, 11 insertions(+) | |
# create mode 100644 orig | |
git mv orig new | |
git commit -m "rename to new" | |
# [master 30b7693] rename to new | |
# 1 file changed, 0 insertions(+), 0 deletions(-) | |
# rename orig => new (100%) | |
git mv new newer | |
gvim newer ### Edit out lines 2 to 5 | |
git add newer | |
git commit -m "Remove 2-5 while renaming" | |
#[master 8d48d55] Remove 2-5 while renaming | |
# 1 file changed, 4 deletions(-) | |
# rename new => newer (65%) | |
git log -p -M1 | cat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
commit 8d48d5535c493776f87f9742b4c4796a74a8b72b | |
Author: Kent Fredric <kentfredric@gmail.com> | |
Date: Thu Sep 18 16:58:56 2014 +1200 | |
Remove 2-5 while renaming | |
diff --git a/new b/newer | |
similarity index 65% | |
rename from new | |
rename to newer | |
index b033488..6130393 100644 | |
--- a/new | |
+++ b/newer | |
@@ -1,9 +1,5 @@ | |
0 | |
1 | |
-2 | |
-3 | |
-4 | |
-5 | |
6 | |
7 | |
8 | |
commit 30b7693516e3679dd33e8c8b297376cea3d3c4ec | |
Author: Kent Fredric <kentfredric@gmail.com> | |
Date: Thu Sep 18 16:57:50 2014 +1200 | |
rename to new | |
diff --git a/orig b/new | |
similarity index 100% | |
rename from orig | |
rename to new | |
commit 284a05c7359df3eacab21956328249ae08179b7a | |
Author: Kent Fredric <kentfredric@gmail.com> | |
Date: Thu Sep 18 16:57:33 2014 +1200 | |
add orig | |
diff --git a/orig b/orig | |
new file mode 100644 | |
index 0000000..b033488 | |
--- /dev/null | |
+++ b/orig | |
@@ -0,0 +1,11 @@ | |
+0 | |
+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