您的位置:首页 > 其它

git学习笔记

2015-05-02 19:44 363 查看
//2015年5月2日19:40:02

alf@alf-virtual-machine:~/Git/repository$ vim readme.txt
alf@alf-virtual-machine:~/Git/repository$ git add readme.txt
alf@alf-virtual-machine:~/Git/repository$ clear

alf@alf-virtual-machine:~/Git/repository$ ls
readme.txt
alf@alf-virtual-machine:~/Git/repository$ git commit -m "wrote readme file"
[master (根提交) b180eca] wrote readme file
1 file changed, 2 insertions(+)
create mode 100644 readme.txt
alf@alf-virtual-machine:~/Git/repository$ git commit -m "Black Test"
位于分支 master
无文件要提交,干净的工作区
alf@alf-virtual-machine:~/Git/repository$ vim readme.txt
alf@alf-virtual-machine:~/Git/repository$ git status
位于分支 master
尚未暂存以备提交的变更:
(使用 "git add <file>..." 更新要提交的内容)
(使用 "git checkout -- <file>..." 丢弃工作区的改动)

修改:         readme.txt

修改尚未加入提交(使用 "git add" 和/或 "git commit -a")
alf@alf-virtual-machine:~/Git/repository$ git diff
diff --git a/readme.txt b/readme.txt
index 46d49bf..9247db6 100644
--- a/readme.txt
+++ b/readme.txt
@@ -1,2 +1,2 @@
-Git is a version control system.
+Git is a distributed version control system.
Git is free software.
alf@alf-virtual-machine:~/Git/repository$ git add readme.txt
alf@alf-virtual-machine:~/Git/repository$ git status
位于分支 master
要提交的变更:
(使用 "git reset HEAD <file>..." 撤出暂存区)

修改:         readme.txt

alf@alf-virtual-machine:~/Git/repository$ git commit -m"change readme.txt"
[master 6534065] change readme.txt
1 file changed, 1 insertion(+), 1 deletion(-)
alf@alf-virtual-machine:~/Git/repository$ git status
位于分支 master
无文件要提交,干净的工作区
alf@alf-virtual-machine:~/Git/repository$


  
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: