git hook script output is added with annoying “[K” postfix

We have a git server that is using msysgit 1.7.11,

We have a setup where we added a post receive hook script,

  • Adding a folder content in Git
  • Rebase branch after removing file from history
  • Disable git automerge
  • How do I fix missing git remote details?
  • How can I undo adding a new file to git?
  • Can git track files but not show them as updated?
  • This script is running a .sh script file that is calling to a .NET executable, so the output for
    this executable is going back to git and through our server back to the client with an annoying “[K” postfix (that is not shown in the console but it does in tools like “git gui”

    Output:

    ...
    remote: New deployment received.[K
    remote: Updating branch 'master'.[K
    ...
    

    Any way to fix this and remove the “[K” postfix?

  • for loop over all git branches with certain name
  • (Git Merging) When to use 'ours' strategy, 'ours' option and 'theirs' option?
  • JGit get pulled files
  • Git Pull vs Git fetch Which one is Preferable?
  • Why does “git pull” exec command get stuck and print nothing?
  • Git error: “fatal: corrupt patch at line 36”
  • One Solution collect form web for “git hook script output is added with annoying “[K” postfix”

    My psychic debugging skills indicate that this [K is probably part of a terminal escape sequence used for clearing to the end of the line (see http://www.termsys.demon.co.uk/vtansi.htm). It sounds like this is probably being generated by the .NET executable as it displays its status messages (which on a normal console, would overwrite one another instead of appearing on separate lines).

    Git Baby is a git and github fan, let's start git clone.