用户信息:
$ git config [ --global ] user.name "XXX"
$ git config [ --global ] user.email XX@XX.COM
检查配置信息:
$ git config --list
$ git config user.name
...
获取帮助:
$ git help <verb> $ git <verb> --help $ man git-<verb>
config命令手册:
$ git help config--2----------------------------------------------------------------------------------------------------初始化仓库: $ git init$ git add *.c $ git add a.txt $ git commit -m 'test01'
$ git clone https://github.com/czx95110/mytest01
$ git clone https://github.com/libgit2/libgit2 mylibgit //rename$ git status [ -s / -short ] //查看文件状态$ cat .gitignore*.[oa] //忽略所有以.o或.a结尾的文件*~ //忽略所有有波浪符~结尾的文件添加远程仓库:$ git remote add [shortname] [url]查询显示: 也可以指定选项 -v,会显示需要读写远程仓库使用的 Git 保存的简写与其对应的 URL。
在项目文件夹右键 git bash here 进入命令行$ git remote -v origin https://github.com/***/*** (fetch) origin https://github.com/***/*** (push)
输入 $ touch .gitignore 生产忽略提交文件。编辑.gitignore 如node_modules.idea