Merge two Git repos and keep the history

后端 未结 3 962
眼角桃花
眼角桃花 2020-12-04 22:41

I want to extend on another question I had: Merge two Git repositories and keep the master history

I have succeeded in merging 2 different repo\'s into one repo. I n

3条回答
  •  情书的邮戳
    2020-12-04 23:21

    There are two options in git rebase that should be of interest in your case:

    p
    --preserve-merges
    

    Recreate merge commits instead of flattening the history by replaying commits a merge commit introduces.

    --committer-date-is-author-date 
    

    (from git am)

    By default the command records the date from the e-mail message as the commit author date, and uses the time of commit creation as the committer date. This allows the user to lie about the committer date by using the same value as the author date.

    Test if the second rebase doesn't yield a better result with:

    git rebase -p --committer-date-is-author-date RepoA/master
    

提交回复
热议问题