Showing posts with label terminal. Show all posts
Showing posts with label terminal. Show all posts

Sunday, January 20, 2013

How to show git branch/status information in bash

extension for terminal/command line to use git more effectively:

For Mac users, (zsh): https://github.com/olivierverdier/zsh-git-prompt

For bash(works fine for Ubuntu): https://github.com/magicmonty/bash-git-prompt
I do following update for /home/USER/.bash/gitprompt.sh :
PROMPT_START="$WHITE$Time12a $Yellow$PathShort$ResetColor"
PROMPT_END=" $ "

For simple branch show(works very fast), (link second comment):
Simply add following line it ~/.bashrc
PS1='[\u@\h`__git_ps1` \W]\$ '



Friday, January 4, 2013

Hotkeys for terminal advanced usage

Web Source: http://allhotkeys.com/ubuntu_hotkeys.html

the most useful and less known commands:

1) Ctrl+D = Log out from the current terminal. In X, this may log you out after a shuting down the emulator.
It is very useful if you have a lot of open terminals(with ssh connection to remote server) and you want to logout from them quickly(without typing 'exit' in each on them)

2) Ctrl+R = History search (Finds the last command matching the letters you type).
Previously I used "history | grep my_command", but this looks like more elegant.

3)Ctrl+L = Clears terminal output.