修改提交得message
git commit --amend
拿出某次提交内容
git cherry-pick <commitId>
合并提交的merge信息
git pull --rebase
查看提交记录
git hist
撤销commit
git reset --soft [历史版本id]
git diff 打patch
git diff > parse.patch //parse 为patch的名字
应用patch
vi ~/Downloads/parse.patch
git apply ~/Downloads/parse.patch
同步服务器分支
git checkout -b dev origin/dev
切换分支
git checkout master
新建远程分支
git checkout -b temp
提交到远程temp分支
git push origin temp
拉取代码
git pull
添加file
git add .
提交信息
git commit -m "提交信息"
查看分支
git branch -a
和远程连接显示
git branch -vv
查看现在客户端指向的服务器的分支
git branch -r
直接指定分支下载 注:master 是远程分支的名称
git clone -b master http://192.168.0.250/hxzh-platform/MicroServicePlatform.git
当本地branch与服务器branch名不一致时提交到对应服务器分支上
git push -f -u origin master //服务器分支
命令查看所有的历史版本,获取某个历史版本id
git log
git push -f -u origin [远程分支]
撤销所有修改
git checkout .
网友评论