Git 基本使用

参考链接

  1. 克隆仓库 git clone [address] [local-name]
  2. 查看本地分支 git branch ,查看远程分支 git branch -r
  3. 删除本地分支 git branch -d [branch-name]
  4. 获取远程分支 git fetch,然后 git checkout -b [local-branch] origin/[remote-branch]
  5. 切换分支 git checkout [branch-name]
  6. 合并指定分支到当前分支 git merge [branch]
  7. 提交代码 git add -A git commit -m "[message]" git push origin [remote-branch]
  8. 迁移仓库 git remote set-url origin [new_remote_git_address]
  9. 查看当前仓库的提交(commit)日志 git log
  10. 将用户名设为author git config --global user.name [author]
  11. 将用户邮箱设为指定邮箱 git config --global user.email [author@corpmail.com]
原文地址:https://www.cnblogs.com/jehorn/p/7744086.html