GIT 常用命令总结

创建测试目录

$ mkdir demo

$ cd demo


初始化git
$ git init


创建测试文件

$ echo "Hello world" > hello

$ echo "Silly example" > example


添加到索引

$ git-add hello example


查看状态

$ git-status


 

$ git-commit -m "Initial commit of gittutor reposistory"


修改测试文件

 

$ echo "It's a new day for git" >> hello


比较差异

 

$ git diff

 

提交修改

$ git add hello

$ git commit -m "new day for git"

 

  或者

$ git commit -a -m "new day for git"



你可能感兴趣的:(git)