git branch switch takes half a minute?

Got an more powerful and fresh machine from work, starting installing dev tools and this is simply nightmare, I’ve never ever had performance issues with git on the old machine. Here it is beyond reason:

ons-mbp:spec ALE$ time git checkout fsfs

Switched to branch 'fsfs'

real    0m30.080s
user    0m0.007s
sys 0m0.006s

    ons-mbp:spec ALE$ time git checkout master

Switched to branch 'master'
Your branch is up-to-date with 'origin/master'.

real    0m30.083s
user    0m0.007s
sys 0m0.007s

Tried reinstalling different git version, tried via homebrew and manually – zero effect.

  • How to import a local GIT/Maven project/folder into eclipse?
  • When Git tells you it failed to push some refs,
  • git rebase -i shortcut — finding the best commit to rebase on
  • How do I change a file with link contents into an actual link in git?
  • Git Remote Branch tracking
  • How can I modify git post-update hook to only activate on one (master) branch?
  • Can anyone provide a hint?

    OS ver: 10.9.5

  • Why does git's cherry picking with more than one commit fail?
  • How to handle big git repository
  • Git: How to remove proxy
  • How to see remote tags?
  • What are the uses cases for git orphaned branches?
  • C++ with git and CMake: How to build submodules with specific parameters?
  • One Solution collect form web for “git branch switch takes half a minute?”

    When doing fresh install completely forgot about setting global user details.

     git config --global user.name "Test Test"
     git config --global user.email "testgmail.com"
    

    Credits to:

    “I normally do this right away when setting up my account on a new machine. The fresh install didn’t trigger that reflex. I’m surprised that this is needed to keep git from preforming silly DNS lookups but no big deal.”

    ons-mbp:spec ALE$ time git checkout master
    Switched to branch 'master'
    Your branch is up-to-date with 'origin/master'.
    
    real    0m0.012s
    user    0m0.006s
    sys 0m0.005s
    ons-mbp:spec ALE$ time git checkout fsfs
    Switched to branch 'fsfs'
    
    real    0m0.012s
    user    0m0.006s
    sys 0m0.005s
    

    Saved from heart attack.

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