Git&GitHun 命令合集
基本操作
- git --version 查看git版本信息
- git add 本地库初始化
设置签名
日志查看
- git log 查看提交记录
- git log --pretty=onelie
- git log --onelie
- git reflog
分支操作
- git branch [分支名] 创建分支
- git branch -v 查看分支
- git checkout [分支名] 切换分支
合并分支
- git checkout [被合并分支名] 切换到接受修改的分支(被合并,增加新内容)上
- git merge [有新内容分支名] 执行 merge 命令
远程仓库操作
- git remote -v 查看当前所有远程地址
- git remote add 别名 远程地址
- git push 别名 分支名
- git origin [远程地址]
- git pull 远程库地址别名 远程分支名
- git merge [远程库地址别名/远程分支名]
- git fetch 远程库地址别名 远程分支名
Git&GitHun 命令合集
原文:https://www.cnblogs.com/yanfei1819/p/9675810.html