git - how to change the computer code



  • The central git repository has an incorrect coding commite, and now, when a linux commite is received, there's a conflict at the merging stage, how do you fix the com code?



  • The commit code can be corrected by:

    $ git filter-branch -f --commit-filter '
    author_type=$( echo $GIT_AUTHOR_NAME | file -b --mime-encoding - )
    author=$( echo $GIT_AUTHOR_NAME | iconv -f $author_type -t UTF-8 )
    GIT_AUTHOR_NAME=$author
    

    committer_type=$( echo $GIT_COMMITTER_NAME | file -b --mime-encoding - )
    committer=$( echo $GIT_COMMITTER_NAME | iconv -f $committer_type -t UTF-8 )
    GIT_COMMITTER_NAME=$committer

    git commit-tree "$@";' --msg-filter '
    cat > .commitmsg
    type=$(cat .commitmsg|file -b --mime-encoding -)
    cat .commitmsg|iconv -f $type -t UTF-8
    ' HEAD

    $ rm -f .commitmsg

    I also recommend that we review. http://git-scm.com/docs/git-commit ♪ Some of the details of the guitar coding work are described near the end.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2