tag (bash)

archive

git-aware ps1 Nov
19
1
0

http://blog.bitfluent.com/post/27983389/git-utilities-you-cant-live-without

You'll need git-completion.bash working, but put the following line into your .bashrc or .bash_profile to display the current branch in your terminal.

PS1='$(__git_ps1 "(%s)")$ '

Which you can combine with whatever you already have setup. It can be something similar to one of the following:

PS1='\h:\W$(__git_ps1 "(%s)") \u\$ '
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\ $(__git_ps1 "(%s)")$ '
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\] $(__git_ps1 "(%s)")$ '

comments

append a file and exporting the path variable in .bashrc file Apr
05
1
0

If you need to include a file in your PATH, you can append it to the existing variable in your .bashrc script file.

export PATH=$PATH:.:~/bin

comments

create an alias in .bashrc file for the bash shell Apr
05
1
0

Sometimes it's helpful to create an alias for common commands. You can insert them into your .bashrc file.

 alias source_project='source ~/envs/project/bin/activate'

comments