打开终端并且输入:

 git config --global credential.helper osxkeychain 

第一次需要输入密码,以后都不需要了