git版本查看以及全局变量配置
$ git version
$ git config --global user.name'Swagcreater'
$ git config --global user.email'[email protected]'
创建新文件夹
$ mkdir swag
创建库以及新文件,并将新文件提交
$ git init
$ touch what.php
$ git add what.php
$ git commit -m'add what.php'
修改所含文件并保存提交
$ ls
what.php//查看目录下所含文件
$ vi what.php//选择文件进行修改,修改完毕后:wq指令进行保存
$ cat what.php
who are you//查看已修改文件内容
$ git status
On branch master
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: what.php//文件已修改
$ git add what.php
$ git commit -m'add what.php'//提交已修改文件
删除文件并提交
$ rm -rf what.php
$ git rm what.php
rm 'what.php'
$ git commit -m'第一次删除文件'