添加和提交 git add -i //交互模式添加 git add -p //交互模式下的path模式 git add somefile git commit -m "changes to somefile" git commit -m "changes to somefile" -a git commit -m "changes to somefile" somefile git config --global alias.ci "commit" 完成git ci = git commit git diff git diff --cached git diff HEAD git mv index.html hello.html 若是不用git mv 则须要git add 新文件和git rm 旧文件 忽略文件 版本库的忽略配置文件.gitignore ".*.swp" 编辑.git/info/exclude文件 实现本地级的忽略 ".*.swp"