当先锋百科网

首页 1 2 3 4 5 6 7



How to take commits from a different repository : Git cherry-pick & format-patch | Void Canvas  http://voidcanvas.com/cherry-pick-format-patch/


总结:

Git cherry-pick <commit-id> : 把一个commit-id的commit应用到当前分支上, 一次只能选择一个"补丁"

git format-patch <old_sha>...<new_sha> -o <patch_dir> : 一次性把多个commit-id做成"补丁", 能同时应用到当前分支上

所以, 当要场景上, 取决于要在当前分支上应用的"commit-id数量", 简单时可用cherry-pick, 复制特性要应用到当前分支时, 可用format-patch



How to take commits from a different repository : Git cherry-pick & format-patch

Don’t know how many of you faced this situation to cherrypick or pull latest commits from an entirely different repo. But this situation is very obvious if you are customizing an existing product for a client and the base product is also getting updated frequently by the team of that.

This article talks about

The articles talks about different processes to to pickup your changes from a different repository. Processes are mentioned in the bullet points below.

By cherry-pick

Cherry picking is a nice process to pickup selective commits from somewhere. It’s easy when you are doing inter branch of the same repo; but a little tricky if you wish to get the commits of a different repository. Below is the code to do so.