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

后端 未结 4 973
暖寄归人
暖寄归人 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:24

    Use this to retrieve hashes from a branch:

    git log --pretty=format:"%h" HEAD..origin/master
    

    Then use git cherry-pick -n to apply each one.

    Another option, as cited by @xenoterracide, is using githooks.

提交回复
热议问题