Some Useful Git Commands
-
Credential caching
Cache git credential (for 15 mins by default), so you don’t have to type in your username and password every time.
git config --global credential.helper cacheYou can provide options via the credential.helper configuration variable (this example increases the cache time to 1 hour).
git config --global credential.helper 'cache --timeout=3600' -
Git
Suggested by Jérôme Kunegis: “Don’t go home when
svn storgitdoesn’t return an empty string”. To get rid of the verbosegit statuscommand, simply add this piece of code to your.bashrcfile, and usegitinstead ofgit status, since the originalgitalmost gives you nothing.git() { if [ $# -eq 0 ] ; then if [ -d ".git" ]; then git log --oneline origin/master..HEAD && git status -s else command git fi else command git "$@" fi } -
Unicode displaying
Use this command to let your git display Unicode characters correctly.
git config --global core.quotepath false