|
本帖最后由 Oeasy 于 2018-1-24 22:29 编辑
Windows 10 下试了下。
1. 安装 Git (略)
2. Git bash 下操作
在 D 盘建一个文件夹 dict
$ mkdir D:/dict
$ cd D:/dict
$ pwd
>/d/dict
$ git init
>Initialized empty Git repository in D:/dict/.git/
新建一个纯文本文件 dict.md ,放到 D:/dict 下
随便在 dict.md 下敲点内容。
># donkey work
单调乏味的苦差事
$ git add dict.md
$ git commit -m "卧槽,终于会了"
>[master (root-commit) 5ccfce8] 卧槽,终于会了
1 file changed, 2 insertions(+)
create mode 100644 dict.md
继续修改 dict.md
># donkey work
单调乏味的苦差事
# drudgery
单调乏味的工作
$ git status
>On branch master
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: dict.md
no changes added to commit (use "git add" and/or "git commit -a")
$ git diff dict.md
>diff --git a/dict.md b/dict.md
index 908125d..1e31895 100644
--- a/dict.md
+++ b/dict.md
@@ -1,2 +1,4 @@
# donkey work
单调乏味的苦差事
+# drudgery
+单调乏味的工作
$ git add dict.md
$ git status
>On branch master
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
modified: dict.md
$ git commit -m "添加了第 2 个词条"
>[master 296bc69] 添加了第 2 个词条
1 file changed, 2 insertions(+)
$ git status
>On branch master
nothing to commit, working tree clean
$ git log
$ git log --pretty=oneline
$ git reflog
$ git reset --hard HEAD^
直接在 Atom 下,更简单直观。
|
|