invalid author/committer line - missing space before email

后端 未结 2 738
灰色年华
灰色年华 2021-01-20 16:47

I have a git repository that was cloned from a bzr repository using git-remote-bzr as follows: git clone bzr::/repo new-repo. After

2条回答
  •  既然无缘
    2021-01-20 17:25

    The solution to my question came from a friend that asked me to write the answer on his behalf:

    1. Filter the repo, changing the bogus author with the following. Note that this should be on two separate lines (normally using shift+enter):

      $ git filter-branch --commit-filter 'case "$GIT_AUTHOR_NAME" in
      > *author\<\ email*) GIT_AUTHOR_NAME=author_name; GIT_AUTHOR_EMAIL=author_email;; esac; git commit-tree "$@" '
      
    2. Since the faulty commits are still in the repository, git fsck will still fail on them. To get rid of those commits, clone the repo and then prune unused objects:

      $ git clone badrepo goodrepo && cd goodrepo
      $ git gc --prune=all
      
    3. The new repository is clean. git fsck returns no errors.

提交回复
热议问题