less typing on git command line

If you’re tired of typing git commands you can set aliases for your favourites.

enter the following command while on the git command line;

git config –global alias.down pull

You can now type ‘git down’ instead of ‘git pull’ as this command creates an alias for pull called ‘down’.

Here’s a few other examples of mine;

git st => git status

git config –global alias.st status

git co => git commit

git commit => git co

git config –global alias.co commit %1

git push => git up

git config –global alias.up push origin master

Accessing github through a http proxy

Accessing gitub can be difficult at work;  ssh tunneling is often blocked by firewalls and proxies make it difficult to use http.

The solution is to set the http_proxy environment variable;

export http_proxy=[PROXY_SETTING]

You can now clone a public git repository over http.

However, this is only half the solution as private repositories use https so this setting doesn’t work.

The solution is the similar https_proxy environment variable.  Set this with the below command;

export https_proxy=[PROXY_SETTING]

You can now clone public and private repositories with http and https through your companies proxy.