2

Recently i created some branches for my project. Seems there's no problem, but i realized whenever i changed from master by using git checkout branch-name it ended throwing me with bunch of korean alphabeth.

screnshot of my problem What did i do wrong?

Thanks in advance

[Solved] So after trying to figuring out the cause of problem, i decided to run brew uninstall git and type git to make sure it's not installed. But somehow it went back to proper english.

4 Answers4

1

Considering you can change the language displayed by Git, do check in your environment the values of the variables:

  • LANG
  • LC_ALL

An export LANG=en_US in a ~/.bash_profile should help.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
1

[Solved] So after trying to figuring out the cause of problem, i decided to run brew uninstall git and type git to make sure it's not installed. But somehow it went back to proper english.

0

OK, let's see. If the language of git is changed, and as indicated by @vonc, it's because some environment variables have changed value, or someone has aliased git to LC_ALL=kr git. How can that have happened? Well, there are hooks which are run every time someone runs a command. By default none of them are installed, but they might be in some company repo templates; they can't be checked out, but someone needs to put them there. The one you are looking for is called post-checkout and should be in the .git/ directory. The fact that, as you point out in your answer, it went back to English, might have nothing to do with it. The environment variable might have been set in an alias, and only work in the checkout terminal.

Baseline is, everything points to a prank. I would check for those git hooks, aliases, and environment variable definitions, just in case.

jjmerelo
  • 22,578
  • 8
  • 40
  • 86
  • But is it possible even if i'm the creator of the repo? It's private laravel project which hosted in private Github's repo and synced locally with me and another code contributor. – Ozy Aloysius Dec 10 '18 at 07:04
  • Well, to set an environment variable or alias you have to run something. The only way you can run something at checkout is using a hook. hooks are not in the repo, so they must be in the repo template (examples of git hooks are already in every repo template, but they are disabled). Aliases are not in the repo either, so they must have been set by the system administrator. I can't think of any other way... – jjmerelo Dec 10 '18 at 07:11
0

FWIW : to view the environment of my git commands, I added the following alias :

git alias env '!env'

So typing git env gives me the list of environment variables after the global set up by git configuration / aliases / options ...

In your case, you could have checked the value of your LANG or LC_* env variable, and see if they were changed from your shell's.

LeGEC
  • 46,477
  • 5
  • 57
  • 104