其他分享
首页 > 其他分享> > 【Gerrit】异常集合 (笔记)

【Gerrit】异常集合 (笔记)

作者:互联网

  1. git config --global user.name ‘xxxxx’ //修改用户名
  2. git config --global user.email ‘xxxxxxx’ //修改邮箱
  3. git commit --amend --reset-author

git pull --rebase origin master //强制把远程库的代码跟新到当前分支上面

git fetch //把远程库的代码更新到本地库

git add . //把本地的修改加到 stage 中

git commit -m ‘comments here’ //把 stage 中的修改提交到本地库

git branch 查看远程分支/全部分支

git checkout master/branch //切换到某个分支

git checkout -b test //新建 test 分支

git checkout -d test //删除 test 分支

git merge master //假设当前在 test 分支上面,把 master 分支上的修改同步到 test 分支上 git merge tool //调用 merge 工具

git stash //把未完成的修改缓存到栈容器中

git stash list //查看所有的缓存

git stash pop //恢复本地分支到缓存状态

git blame someFile //查看某个文件的每一行的修改记录()谁在什么时候修改的)

git status //查看当前分支有哪些修改

git log //查看当前分支上面的日志信息

git diff //查看当前没有 add 的内容

git diff --cache //查看已经 add 但是没有 commit 的内容

git diff HEAD //上面两个内容的合并

git show commit-id //显示某次 commit-id 的修改内容

git reset --hard HEAD //撤销本地修改

git reset --hard commit-id //撤销 commit-id 前面的所有修改

git apply test.patch //打包 patch

标签:git,修改,--,Gerrit,笔记,test,集合,commit,分支
来源: https://blog.csdn.net/baidu_34587520/article/details/121920175