git/repo

git push origin HEAD:refs/for/branch  (need code review)

git push origin HEAD:refs/heads/branch   (no need code reivew)

git branch -a

HEAD detached from origin/branchName

git push origin HEAD:refs/for/branchName

static manfiest


.create static.xml from other good branch


repo manifest -r -o static.xml (or copy from cmweb)


.use good static.xml to sync code


repo init ...-b l-lagan


copy static manifest (static.xml) to .repo/manfiest (same path as default.xml)


cd myrepo/laganl


repo init -m static.xml (same path as default.xml)


repo sync




[edit] get patch change


got old patch name


git format-patch -k b231b5b89195556fa469cdafacd089eafaebf7a2^..b231b5b89195556fa469cdafacd089eafaebf7a2 >~/temp/a.patch


got old patch change


git format-patch -k b231b5b89195556fa469cdafacd089eafaebf7a2^..b231b5b89195556fa469cdafacd089eafaebf7a2 --stdout >~/temp/a.patch


git format-patch -1 4c44737d4f59ca4900fb79cf5a0474f6b19e7ec9

git diff oldId newId > ~/temp/temp.diff

git diff HEAD^ HEAD 

git am 会直接使用patch文件中的diff的信息,还有提交者,时间等等来自动提交,不需要我们再去提交commit

git am 必须使用的是用git format-patch 生成的patch文件来打补丁,而不能是使用git diff生成的patch

git apply 可以应用使用git diff 和git format-patch生成的2种patch来打补丁.

使用git apply 命令之后patch文件中的修改会自动合入到对应的文件中,但是不会帮我们自动提交这个commit.

如果没有什么冲突提示就直接使用git commit提交就可以了

如果有冲突,可以用git apply –reject

或者解决冲突后git am –continue

git push出现如下错误

error: unpack failed: error Missing tree ....

git push --no-thin origin HEAD:refs/for/***

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值