Home > Blockchain >  Why is Git Outputting this Strange Text?
Why is Git Outputting this Strange Text?

Time:02-17

git version 2.35.1

When I run git, it is outputting some odd text that seems to be unrelated to the running of the subcommand:

$ git push
\S
Kernel  on an 
Everything up-to-date

As can be seen here is is outputting:

\S

Kernel on an

Is this a bug, or what is the deal?

$ echo $0 $SHELL
-zsh /bin/bash
$ git --version
git version 2.35.1
$ git status
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean
$ git remote -vv
origin  <redacted>:<redacted>.git (fetch)
origin  <redacted>:<redacted>.git (push)
$ git push --verbose
Pushing to <redacted>:<redacted>.git
\S
Kernel  on an 
To <redacted>:<redacted>.git
 = [up to date]      master -> master
updating local tracking ref 'refs/remotes/origin/master'
Everything up-to-date
$ ls -1 .git/hooks
applypatch-msg.sample
commit-msg.sample
fsmonitor-watchman.sample
post-update.sample
pre-applypatch.sample
pre-commit.sample
pre-merge-commit.sample
pre-push.sample
pre-rebase.sample
pre-receive.sample
prepare-commit-msg.sample
push-to-checkout.sample
update.sample
$ cat .git/hooks/*push
zsh: no matches found: .git/hooks/*push
$ which git
/usr/local/bin/git

$ file /usr/local/bin/git
/usr/local/bin/git: Mach-O 64-bit executable x86_64

CodePudding user response:

The text

\S
Kernel  on an \S

is almost certainly the ssh pre-login banner configured for the ssh daemon on the server you are pushing to. It is defined on the server in the /etc/issue file.

It appears to be misconfigured, as the login banner is probably intended to show something like:

Redhat blah blah blah
Kernel 2.6.11.12 on an i486

You can verify this by ssh'ing to the server directly, which is more or less what @torek suggested.

  •  Tags:  
  • git
  • Related