If you have problems pulling or pushing code from a Stash Git origin, you’re most probably using an old version of git, prior to version 1.8.
The reason for the 400 (Bad Request) error is that stash expects the new http authentication scheme, while older git clients provide the basic http authentication scheme. This affects pull, push and clone git commands.
This is particularly a nuisance with Mac OS X users, as git is bundled with Xcode. To check which version you’ve got, just run the following command:
It will most likely then not reply:
git version 188.8.131.52 (Apple Git-31.1)
OK. So now you need to either build git yourself by pulling git from github:
git clone git://github.com/gitster/git.git
and then build it:
sudo make prefix=/usr install install-doc install-html install-info
If you prefer to install prepackages binaries, you will ant to use MacPorts, which you can download from http://www.macports.org/
After Installing, run
sudo port selfupdate
sudo port install git-core
The new Git binary is in /opt/local/bin so make sure to relink /usr/bin/git to /opt/local/bin/git