Git常用的命令
1.查看当前的配置列表
git config --list
git config --list --show-origin
2.配置用户名和邮箱 --global 为全局配置,局部配置可用 --local
git config --global user.name "your name"
git config --global user.email "your email site"
3.初始化
git init
git clone websites
4.加入待提交区域,提交全部文件可用 . 或者 -A
git add <filename>
git add .
git add -A
5.提交,并备注信息
git commit -m "first commit or other info"
6.查看提交历史,参数 --stat 用于显示更全的信息
git log --stat
7.撤回
git checkout <filename>
git reset HEAD^1
8.分支
git checkout -b <branchname>
git branch
git checkout <branchname>
git branch -D <branchname>
git merge <branchname>
git merge --abort
9.Git与GitHub远程仓库
git push
git pull