How to pull one commit at a time from a remote git repository?

后端 未结 4 974
暖寄归人
暖寄归人 2021-01-12 07:40

I\'m trying to set up a darcs mirror of a git repository. I have something that works OK, but there\'s a significant problem: if I push a whole bunch of commits to the git

4条回答
  •  太阳男子
    2021-01-12 08:25

    git remote update # fetch all remotes I like it better than just fetch

    git log origin/master # can be any remote/branch

    git cherry-pick origin/master # example remote/branch you can also specify a sha1

    cherry-pick will pick the top patch by default.

    for the third part I think you'll have to write a script to do it for you. there are other ways to get the hashes and lots of options for log. Actually there might be a hook for cherry-pick or maybe just post commit... to run the darcs code. check out git hooks.

    in fact on that note each patch applied in a rebase might call a git commit hook so you might be able to write that and then do a git pull --rebase and have that code nailed on each apply...

提交回复
热议问题