git指定版本,SHA-1短的,长的都可以

git checkout c66a9be
git checkout c66a9befsadf1sdf1s3fd21
git log
##查询本地log git log --remotes
##查询服务器端log
git rebase xxxxBranch -Xignore-all-space
git rebase xxxxBranch
git rebase --continue ###反悔的几个语句
git rebase --abort
git reset merge #刚学来的,挺好用.
git rev-list origin/dev..HEAD -n 1
 
#review 代码 最近在搞gerrit,挺有意思
#下面这句相当于是勾选打分.自定义标签要--label这样来做.
ssh -p xxx@xxxxxxxxx gerrit review --code-review + --verified + --label workflow=+ --message "OK" 075a5bf

#相当于按submit按钮
ssh -p xxx@xxxxxxxxx gerrit review --submit 075a5bf

#这句没什么用, 看在队列中排着多少个
ssh -p xxx@xxxxxxxxx gerrit show-queue

#看gerrit的版本
ssh -p xxx@xxxxxxxxx gerrit version #这两句不知道干嘛的
ssh -p xxx@xxxxxxxxx gerrit index changes
ssh -p xxx@xxxxxxxxx gerrit index start changes #这句是查看自己可以看到的项目
ssh -p xxx@xxxxxxxxx gerrit ls-projects #查看自己review权限(?)项目的最新提交(即使别人没有把自己弄成reviewer,也可以这样看到,哈哈)
ssh -p xxx@xxxxxxxxx gerrit query --submit-records #查看某某项目最新的一条待reivew记录,提交记录
ssh -p xxx@xxxxxxxxx gerrit query project:xxx/xxx/xxx --submit-records limit:1 #自动打分,哈哈哈, 过几天试试自动加上行评
ssh -p xxx@xxxxxxxxx gerrit review --code-review + --verified + --label workflow=+ --message "OK" $(git rev-list origin/dev..HEAD -n ) #上一句要跟上commitId,$(git rev-list origin/dev..HEAD -n 1)只能查询本地的commitId, 而如果需要交叉互评的时候, 就需要获取一下服务器端的commitId, 是这样的.
ssh -p 29418 xxx@xxxxxxxxx gerrit query project:xxx/xxx/xxx gerrit query project:xxxxxx --dependencies limit:1

显示中:revision 就是SHA1, 但是这个也不对, 因为这个是parent的sha,而不是自己的

dependsOn:
id: Ib0xxxxxxxxdee146a6393xxxx9754bfb
number: 123456
revision: 075a5bxxxxxxx1053ea48fxxxxxxx2518fd8f
ref: refs/changes/78/4004978/1
isCurrentPatchSet: true

git commit --amend用法 抄别人写的, 非常好

什么情况下用?
比方说,你的代码已经提交到git库,leader审核的时候发现有个Java文件代码有点问题,于是让你修改,通常有2种方法: 方法1:leader 将你提交的所有代码 abandon掉,然后你回去 通过
git reset …
将代码回退到你代码提交之前的版本,然后你修改出问题的Java文件,
然后
git add xx.java xxx.java -s -m “Porject : .修改bug…”
最后通过
git push origin HEAD:refs/for/branches 方法2:
leader不abandon代码,你回去之后,修改出问题的Java文件,修改好之后,
git add 该出问题.java
然后
git commit –amend –no-edit,
最后
git push origin HEAD:refs/for/branches。
---------------------
作者:小猪快跑22
来源:CSDN
原文:https://blog.csdn.net/zhujiangtaotaise/article/details/73505770
版权声明:本文为博主原创文章,转载请附上博文链接!

git点滴的更多相关文章

  1. git点滴的积累

    git的基本学习的网址: http://www.yiibai.com/git/git_update_operation.html 0.git首次上传代码 http://www.cnblogs.com/ ...

  2. Git点滴记录

    合并多个commit记录 假设我们当前有三个commit信息,现在要将commit hash为 23f92c 和 409978 合并 //git rebase -i HEAD~3 那么我们可以使用 r ...

  3. Git合并指定一系列commits到另一个分支

    Git合并指定文件到另一个分支经常被问到如何从一个分支合并特定的文件到另一个分支.其实,只合并你需要的那些commits,不需要的commits就不合并进去了. 合并某个分支上的单个commit首先, ...

  4. git使用点滴:如何查看commit的内容

    在push之前有时候会不放心是不是忘记加某些文件,或者是不是多删了个什么东西,这时候希望能够看看上次commit都做了些什么. 一开始想到的是用Git diff,但是git diff用于当前修改尚未c ...

  5. Git使用点滴记录: You have no permission to access this repo.

    代码托管在https://coding.net上面,之前Git用https的方式都好好的,没有出什么问题.结果今天git pull代码的时候一直提示以下信息: remote: Coding.net T ...

  6. Vim编辑器点滴积累

    Vim编辑器点滴积累 vim tab键空格数量控制 参考链接 临时:进入VIM,执行: :set tabstop=4 永久:编辑用户目录下.vimrc文件,添加:set tabstop=4 vim 安 ...

  7. git学术

    点滴是为了生活,学术是为了未来.点滴经常看,学术用到的时候看看. #### git add 之后, git reset HEAD filename 和git checkout HEAD filenam ...

  8. Git使用之submodule

    入职第一周,就因为clone项目而产生了很大的障碍,花了差不多三四个小时才定位问题并解决,记录一下. 一.问题 当我们在使用Git克隆项目的时候,无法克隆下来一个文件夹.记该文件夹为A,A在远程仓库是 ...

  9. Git 子模块 - submodule

    有种情况我们经常会遇到:某个工作中的项目需要包含并使用另一个项目. 也许是第三方库,或者你 独立开发的,用于多个父项目的库. 现在问题来了:你想要把它们当做两个独立的项目,同时又想在 一个项目中使用另 ...

随机推荐

  1. Retrotranslator使用简介(JDK1.5->1.4)

      Retrotranslator是一个可以把JDK1.5(6)下编译的类(或包)转译成JDK1.4下可以识别的类(包)的工具. 为现在还用JDK1.4呢?我想无非是现在的大部分Java Web应用是 ...

  2. Json ignore on class level

    Exclude all instances of a class from serialization in Newtonsoft.Json Every custom type can opt how ...

  3. leetcode-mid-Linked list- 103. Binary Tree Zigzag Level Order Traversal

    mycode 99.24% # Definition for a binary tree node. # class TreeNode(object): # def __init__(self, x) ...

  4. 用流的方式来操作hdfs上的文件

    import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import ...

  5. clientdataset 读取excel 如果excel 文件不存在的时候 相应的gird 会不显示数据, 鼠标掠过 gird 格子 才会显示数据。 这是一个bug 哈哈

    clientdataset 读取excel   如果excel 文件不存在的时候   相应的gird 会不显示数据, 鼠标掠过 gird 格子 才会显示数据.   这是一个bug 哈哈

  6. Delphi 遍历类中的属性

    http://blog.csdn.net/easyboot/article/details/8004954 Delphi 遍历类中的属性 标签: delphistringbuttonclassform ...

  7. 修改属性item1(1变化)

    给imgList1,7,12,16添加数据 数据层data:{imgList1:[],imgList7:[],imgList12:[],imgList16:[],} 处理层let _this=this ...

  8. python实现建立udp通信

    实现代码如下: #udp协议通信import socket,timeclass UdpConnect: def get_udp(self,ip,port,message): #建立udp连接 myso ...

  9. xmake-vscode插件开发过程记录

    最近打算给xmake写一些IDE和编辑器的集成插件,发现vscode的编辑器插件比较容易上手的,就先研究了下vscode的插件开发流程,并且完成了xmake-vscode插件的开发. 我们先来看几张最 ...

  10. WebServiceBinding属性

    属性 类型 读 写 说明 ConformsTo Wsiprofiles x x 绑定需要遵守的WS-I标准 EmitConformanceClaims Boolean     如果为true,当WSD ...