时光机穿梭

2016-06-30  本文已影响21人  952625a28d0d
Git is a distributed version control system.
Git is free software.```

- 现在,运行git status 命令看看结果:

appledeMacBook-Pro:GitRespository JiaYuanFa$ 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: readme.pages

Untracked files:
(use "git add <file>..." to include in what will be committed)

.DS_Store

no changes added to commit (use "git add" and/or "git commit -a")
appledeMacBook-Pro:GitRespository JiaYuanFa$ ```

git告诉我们修改了内容,我们用git diff查看修改了什么内容

git giff```

![Paste_Image.png](https://img.haomeiwen.com/i189984/2a52f3e2944c4940.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

#####提交修改和提交新文件是一样的两步,第一步是git add
:

git add readme.pages```

同样没有任何提示,说明成功了


Paste_Image.png
git status```

可以看到文件被修改
![Paste_Image.png](https://img.haomeiwen.com/i189984/4f302e7eba31d205.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

提交

git commit -m "change redeme.page file"```

提交成功!


git status```

git 告诉我们没有什么可提交的
![Paste_Image.png](https://img.haomeiwen.com/i189984/2f12f811c91917a7.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

###总结

要随时掌握工作区的状态,使用git status命令。
如果git status告诉你有文件被修改过,用git diff可以查看修改内容。




上一篇下一篇

猜你喜欢

热点阅读