Created
April 15, 2016 17:58
-
-
Save bitops/a1596862eb6620c9deeb9037b6ab69c8 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
$ git init . | |
Initialized empty Git repository in /Users/swittnekamp/tmp/git_index/.git/ | |
$ cat <<EOF > foo.txt | |
Some example content | |
EOF | |
$ git add foo.txt | |
$ git status | |
On branch master | |
Initial commit | |
Changes to be committed: | |
(use "git rm --cached <file>..." to unstage) | |
new file: foo.txt | |
$ git commit -m "Add foo" | |
[master (root-commit) 0cf172d] Add foo | |
1 file changed, 1 insertion(+) | |
create mode 100644 foo.txt | |
$ sed -i -e 's/example/banana/' foo.txt | |
$ git diff | |
diff --git a/foo.txt b/foo.txt | |
index e8ef7a2..162472c 100644 | |
--- a/foo.txt | |
+++ b/foo.txt | |
@@ -1 +1 @@ | |
-Some example content | |
+Some banana content | |
$ git add foo.txt | |
$ git status | |
On branch master | |
Changes to be committed: | |
(use "git reset HEAD <file>..." to unstage) | |
modified: foo.txt | |
$ sed -i -e 's/Some/Yellow/' foo.txt | |
$ git diff | |
diff --git a/foo.txt b/foo.txt | |
index 162472c..366cb25 100644 | |
--- a/foo.txt | |
+++ b/foo.txt | |
@@ -1 +1 @@ | |
-Some banana content | |
+Yellow banana content | |
$ git status | |
On branch master | |
Changes to be committed: | |
(use "git reset HEAD <file>..." to unstage) | |
modified: foo.txt | |
Changes not staged for commit: | |
(use "git add <file>..." to update what will be committed) | |
(use "git checkout -- <file>..." to discard changes in working directory) | |
modified: foo.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment