Git 常用命令 git clone1234567891011# public 工程git clone https://github.com/Zlorn/xxx# 带用户名和密码访问git clone https://UserName:password@github.com/Zlorn/xxx# 带邮箱和密码访问,邮箱的 @ 符号需要 URL 转码为 %40git clone https://xxx%40qq.com:password@github.com/Zlorn/xxx# clone 到指定目录git clone https://github.com/Zlorn/html-test testCopy git add123# 暂存更改,即将文件的修改添加到暂存区git add a.txtgit add .Copy git commit1git commit -m "xxx"Copy git commit –amend12# 修改最后一次提交的 log,使用此命令后会进入 vim 编辑界面,使用 vim 命令修改 log 即可。git commit --amendCopy git pull1234git pull# 指定路径git -C <path> pullCopy git push1git pushCopy git reset12345678# 取消暂存更改,即将 a.txt 从暂存区移除git reset head a.txt# 还原 a.txt 本地更改,注意不要忘记中间的"--",不写就成了切换分支了git checkout -- a.txt# 取消暂存更改,并还原本地所有更改git reset head .git checkout .Copy git merge –abort12# 取消合并git merge --abortCopy Git Git SVN 迁移指定目录 上一篇 SVN 常用命令 下一篇