用到命令
- 克隆代码 git clone https://github.com/mrxiaoyu100001/Android-.git
- git add . // 添加本地缓存区
- git commit -m ‘备注’ //推送到本地库
- git push origin //推送到远程库
- git log -p -2 // 查看最近两次提交版本的日志
- git diff //比较工作区与暂缓区的不同
- git diff --cache //比较暂缓区与本地库的不同
- git diff – HEAD // 比较工作区与本地库的不同
- git diff commit-id //比较暂缓区与 commit-id的不同
- git rebase b //把b合并到当前分支
- git merge b //同样把b合并到当前分支
- git fetch project-name //从另一个项目下载对象和引用
- git fetch //同步远程远程分支
- git branch -a // 查看所有分支
- git branch -r //查看远程分支
- git remote add project_name ssh://git@git.sprucetec.com:50022/procurement1601/supplier_app.git //添加远程库到本地
- git fetch project-name // 下载远程库更新对象
- git checkout master //切换到主分支
- git rebase project-name //将远程分支的代码rebase到本地master分支上
- git regest //回退提交本地库的文件
- git checkout // 把当前修改的文件从HEAD中迁出并变成为修改的样子
- git rebase --continue //继续合并
- git rebase --skip //跳过这个冲突继续合并
- git rebase --abort //
- git reset --hard origin/master //主分支放弃这个修改
- git stash //保存当前修改,恢复到上次提交的版本
- git stash list //stash栈中stash列表
- git stash pop stash@{