Git merge single file from another repository into my own

后端 未结 4 754
耶瑟儿~
耶瑟儿~ 2020-12-31 13:08

Say I have my own git repo with a bunch of text files in it. There is another different git repo that someone else owns with a bunch of text files that all differ from my ow

4条回答
  •  一向
    一向 (楼主)
    2020-12-31 13:40

    You can merge arbitrary files or repo objects. Simplest might be:

    git merge-file file.txt <(git show last-merged-file.txt) /path/to/their/file.txt
    # resolve any conflicts, then
    git tag last-merged-file.txt `git hash-object-w file.txt`
    

提交回复
热议问题