git cherry-pick

//Git 手册大全:

1.5 起步 - 安装 Git :

https://git-scm.com/book/zh/v2/%E8%B5%B7%E6%AD%A5-%E5%AE%89%E8%A3%85-Git

 

惊群与负载均衡,C++;

tcpdaemon是一个TCP通讯服务端平台/库 tcpdaemon
https://www.codercto.com/soft/d/232.html

自学汇编(一)
https://blog.csdn.net/lyztyycode/article/details/97294295

Linux惊群效应详解(最详细的了吧)
https://blog.csdn.net/lyztyycode/article/details/78648798
制作linux c自动编译工具, 先参考cmake;

C++中虚函数使用和详解
https://www.cnblogs.com/jameflight/p/10559099.html
C++虚函数与纯虚函数用法与区别
https://www.cnblogs.com/inception6-lxc/p/8597326.html
c++虚函数详解(你肯定懂了)
https://blog.csdn.net/lyztyycode/article/details/81326699


C语言中"#"和"##"的用法
https://blog.csdn.net/baidu_33850454/article/details/79363033

git 工具使用篇:

git fetch 与 git pull 的区别
https://www.jianshu.com/p/64ef955e9c44

git的几个小技巧
https://blog.csdn.net/mengyafei43/article/details/39322057
https://www.codercto.com/a/45325.html

git cherry git fetch
https://blog.csdn.net/kongbaidepao/article/details/82054114
content:
将服务器代码 整合到本地
打开 gerrit,
右上角   download ,  选择 ssh -- 即可看到   
git fetch xxxxxxx
然后需要  git cherry-pick

Gerrit日常维护记录
https://www.cnblogs.com/kevingrace/p/5674370.html

git总结三、关于分支下——团队合作中最重要的合并分支
https://www.cnblogs.com/youyang-2018/p/10790422.html

git cherry-pick使用总结 :
https://blog.csdn.net/u012953143/article/details/86490929
https://git-scm.com/docs/git-cherry-pick
 
git abandon某条提交导致后续提交无法merge问题

git with gerrit 常用操作解析 :
https://blog.csdn.net/smithallenyu/article/details/50175503

 

git 常用命令:

   git cherry-pick合并某个commit :
   https://www.cnblogs.com/0201zcr/p/5752771.html

   git 撤销本地commit
   https://blog.csdn.net/M_Eve/article/details/84334794
   https://blog.csdn.net/weixin_30952535/article/details/96156965
git reset 使用及回滚
   https://blog.csdn.net/edric1261234/article/details/82796506
   
1) Git撤销本地commit :
https://blog.csdn.net/weixin_44722978/article/details/94438640
问题:在mster分支写了半天,然后git commit 提交了 ,才发现 在masrter分支开发的。
解决:
git reset HEAD~
HEAD 代表:上一次提交
这样 刚刚提交的就又回到本地的local changes 列表中。
nice
继续 切换分支, 重新提交。
2)git with gerrit 常用操作解析
https://blog.csdn.net/smithallenyu/article/details/50175503
3)git&gerrit 使用过程中遇到的问题及解决方法
https://blog.csdn.net/smithallenyu/article/details/50205817
4)Gerrit 提示冲突,不能合并代码(git解决远程冲突)
https://blog.csdn.net/w_jewelry/article/details/8123639
5)gerrit提交被拒绝
https://www.jianshu.com/p/98239a7bccda

 

origin HEAD
[Git]head,master,origin区别
https://blog.csdn.net/wag2765/article/details/84763182
原文:http://stackoverflow.com/questions/8196544/what-are-the-git-concepts-of-head-master-origin

git origin 和master的含 :
https://blog.csdn.net/xingqingly/article/details/53172874
官方教程:
https://git-scm.com/book/zh/v2/%E8%B5%B7%E6%AD%A5-%E5%91%BD%E4%BB%A4%E8%A1%8C
“origin” 并无特殊含义
远程仓库名字 “origin” 与分支名字 “master” 一样,在 Git 中并没有任何特别的含义一样。 同时 “master” 是当你运行 git init 时默认的起始分支名字,原因仅仅是它的广泛使用,“origin” 是当你运行 git clone 时默认的远程仓库名字。
如果你运行 git clone -o booyah,那么你默认的远程分支名字将会是 booyah/master。


参考 : 
Git 的origin和master分析 push/diff/head   ( ---Good--  )
https://blog.csdn.net/angle_birds/article/details/22853105
1、origin/master : 一个叫 origin 的远程库的 master 分支
2、HEAD指向当前工作的branch,master不一定指向当前工作的branch
3、git  push  origin  本地分支A : 远程分支B ---> push 本地分支A到远程库origin的分支B

首先要明确一点,对git的操作是围绕3个大的步骤来展开的(其实几乎所有的SCM都是这样)
1.     从git取数据(git clone)
2.     改动代码
3.     将改动传回git(git push)

这3个步骤又涉及到两个repository,一个是remote repository,再远程服务器上,一个是local repository,再自己工作区上。其中
1, 3两个步骤涉及到remote server/remote repository/remote branch,
2涉及到local repository/local branch。git clone 会根据你指定的remote server/repository/branch,拷贝一个副本到你本地,再git push之前,你对所有文件的改动都是在你自己本地的local repository来做的,你的改动(local branch)和remote branch是独立(并行)的。Gitk显示的就是local repository。

在clone完成之后,Git 会自动为你将此远程仓库命名为origin(origin只相当于一个别名,运行git remote –v或者查看.git/config可以看到origin的含义),并下载其中所有的数据,建立一个指向它的master 分支的指针,我们用(远程仓库名)/(分支名) 这样的形式表示远程分支,所以origin/master指向的是一个remote branch(从那个branch我们clone数据到本地),但你无法在本地更改其数据。

同时,Git 会建立一个属于你自己的本地master 分支,它指向的是你刚刚从remote server传到你本地的副本。随着你不断的改动文件,git add, git commit,master的指向会自动移动,你也可以通过merge(fast forward)来移动master的指向。
$git branch -a (to show all the branches git knows about)

* master
  remotes/origin/HEAD -> origin/master
  remotes/origin/master

$git branch -r (to show remote branches git knows about)
 origin/HEAD -> origin/master
 origin/master

可以发现, master就是local branch, origin/master是remote branch(master is a branch in the local repository. remotes/origin/master is a branch named master on the remote named origin)
$git diff origin/master master (show me the changes between the remote master branch and my master branch).

需要注意的是,remotes/origin/master和origin/master的指向是相同的
$git diff origin/master remotes/origin/master

Git Push:
git push origin master
origin指定了你要push到哪个remote
master其实是一个“refspec”,正常的“refspec”的形式为”+<src>:<dst>”,冒号前表示local branch的名字,冒号后表示remote repository下 branch的名字。注意,如果你省略了<dst>,git就认为你想push到remote repository下和local branch相同名字的branch。听起来有点拗口,再解释下,push是怎么个push法,就是把本地branch指向的commit push到remote repository下的branch,比如

$git push origin master:master (在local repository中找到名字为master的branch,使用它去更新remote repository下名字为master的branch,如果remote repository下不存在名字是master的branch,那么新建一个)
$git push origin master (省略了<dst>,等价于“git push origin master:master”)
$git push origin master:refs/for/mybranch (在local repository中找到名字为master的branch,用他去更新remote repository下面名字为mybranch的branch)
$git push origin HEAD:refs/for/mybranch (HEAD指向当前工作的branch,master不一定指向当前工作的branch,所以我觉得用HEAD还比master好些)
$git push origin  : mybranch (再origin repository里面查找mybranch,删除它。用一个空的去更新它,就相当于删除了)


gerrit不能对一个已经merge/abandon的change进行再次提交
https://blog.csdn.net/bingyu880101/article/details/52117450

Gerrit日常维护记录 :
https://www.cnblogs.com/kevingrace/p/5674370.html
{
    远程分支的标识形式为{remote/branch},比如origin/product。
    $: git branch -a
    master
    p4popt
    * prepub
    product
    remotes/origin/HEAD -> origin/master
    remotes/origin/master
    remotes/origin/p4popt
    remotes/origin/prepub
    remotes/origin/product
    远程分支和本地分支需要区分,所以,在从服务器上拉取特定分支的时候,需要指定本地分支名字。
    $: git branch product origin/product
    Branch product set up to track remote branch product from origin.
}


Gitlab备份和恢复操作记录 :
https://www.cnblogs.com/kevingrace/p/7821529.html

1 : 1)与 2)包含git库的图片:
1) git fetch 与 git pull 的区别 :
https://www.jianshu.com/p/64ef955e9c44
https://www.cnblogs.com/jing-tian/p/11154485.html
2) 详解git pull和git fetch的区别:
https://blog.csdn.net/weixin_41975655/article/details/82887273
确认 git 中的 head是指向哪里?

git rm使用指南
https://blog.csdn.net/u012953143/article/details/88420386
https://www.cnblogs.com/kevingrace/p/5674444.html

git-cherry-pick(1)
https://linux.die.net/man/1/git-cherry-pick

git-cherry-pick – Apply the changes introduced by some existing commits.
实际开发中会有这种情况:同时存在 v1、v2 两个分支,且不可合并。然后发现两个分支都存在某 bug,在 v1 中修复,需要合并到 v2,要么手动修改,
或者用 git cherry-pick : git cherry-pick 0ba264a1e666bacc

 


 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值