Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Like ephemient said, you will want to have that <a href="http://git.kernel.org/?p=git/git.git;a=blob;f=contrib/completion/git-completion.bash;hb=HEAD" rel="nofollow noreferrer">Git bash script installed</a>, installation instructions are near the top of the file. You might also want to check out the <a href="http://github.com/guides/put-your-git-branch-name-in-your-shell-prompt" rel="nofollow noreferrer" title="put your git branch name in your shell prompt">Github guide page</a> for this. One thing worth noting is that the branch will only show up if you are in a git directory. For example, this is what my normal prompt looks like: <code>blaenk@macbook:~ $</code> and the prompt looks like this when I am in a git directory: <code>blaenk@macbook:~/code/iphone/DIFM (master*)$</code></p> <p>If you look closely, the part where it shows the branch, master, has an asterisk after it. This signifies that there are unstaged changes; it will show a + if changes are staged. This can be pretty helpful. To do this, you basically have to set <code>GIT_PS1_SHOWSTASHSTATE</code> to a non-empty state. So for example in your <code>~/.bashrc</code> or <code>~/.bash_profile</code>, put the following:</p> <pre><code>export GIT_PS1_SHOWDIRTYSTATE=true </code></pre> <p>Now when you go to a git directory, you should see the indicator if there are any unstaged changes or if there are any staged changes. You can test this out really quick by editing a file. The asterisk should show up. You can then restore the file to its original state by doing:</p> <pre><code>git checkout -- the/file.txt </code></pre> <p>By the way, that auto complete bash script is also really awesome. You can finally do stuff like 'git chec' then press TAB, and it'll autocomplete to checkout for example, and you can also auto complete branch names too.</p> <p>Some other resources you will most likely be interested in are the following, which guide you through the process of shaping your prompt the way you want it, and if you want, adding color to certain parts, which can make for a much more readable and informative prompt. Just try not to overdo it.</p> <ul> <li><a href="http://www.cyberciti.biz/tips/howto-linux-unix-bash-shell-setup-prompt.html" rel="nofollow noreferrer">How to: Change / Setup bash custom prompt (PS1)</a></li> <li><a href="http://www.cyberciti.biz/faq/bash-shell-change-the-color-of-my-shell-prompt-under-linux-or-unix/" rel="nofollow noreferrer">BASH Shell change the color of my shell prompt under Linux or UNIX</a></li> </ul>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload