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/***