最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

git - There is one active patchset which is not merged to my Master....I want to merge that patch set to my local and don&#3

programmeradmin5浏览0评论

There is new version of 8 of my files which I have cloned , Those new 8 files are presented in a patchset which is not yet merged with the master,So I want to replace my old 8 files in local with that patchset without merging the master, How can I do it? (Gerrit)

There is new version of 8 of my files which I have cloned , Those new 8 files are presented in a patchset which is not yet merged with the master,So I want to replace my old 8 files in local with that patchset without merging the master, How can I do it? (Gerrit)

Share Improve this question edited Mar 11 at 19:25 Guildenstern 3,9622 gold badges28 silver badges54 bronze badges asked Mar 11 at 6:52 ABD saleemABD saleem 11 silver badge
Add a comment  | 

1 Answer 1

Reset to default 1

Switch to the page of the patchset. You can find "DOWNLOAD" or "Download", depending on the Gerrit version, on the page. Press it and it shows a series of commands for checkout, cherry-pick, format-patch, and etc. Copy the git fetch command before && and run it in the local repository to make sure the commit of the patchset is present in the local repository.

To use the 8 files of this commit to overwrite their counterparts in the working tree,

# multiple files in one command
git checkout $commit -- path/to/file1 path/to/file2 ...

# or one file in one command
git checkout $commit -- path/to/file1
git checkout $commit -- path/to/file2

If you want to apply the patch of this commit instead,

git cherry-pick $commit

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论