添加和提交 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"