Skip to content

Instantly share code, notes, and snippets.

@hack0001
Forked from ivanoats/gist:1823034
Created January 23, 2019 23:59
Show Gist options
  • Save hack0001/c2708610d5dc2af9986e3385455238a0 to your computer and use it in GitHub Desktop.
Save hack0001/c2708610d5dc2af9986e3385455238a0 to your computer and use it in GitHub Desktop.

Revisions

  1. @ivanoats ivanoats revised this gist Mar 5, 2013. 1 changed file with 7 additions and 0 deletions.
    7 changes: 7 additions & 0 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,10 @@
    To see what shell you are using, you can:

    ```echo $SHELL```
    and it will tell you.

    Use the below only if you are using bash.

    Run the following to create `~/.git-completion.bash`:

    curl https://raw.github.com/git/git/master/contrib/completion/git-completion.bash > ~/.git-completion.bash
  2. @ivanoats ivanoats revised this gist Mar 5, 2013. No changes.
  3. @ivanoats ivanoats revised this gist Mar 5, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -15,7 +15,7 @@ Then add the following to your `~/.bashrc` or `~/.bash_profile` after `PATH`:
    # Source the git bash completion file
    if [ -f ~/.git-completion.bash ]; then
    source ~/.git-completion.bash
    source ~/.git-prompt.sh
    source ~/.git-prompt.bash
    PS1='[\u@\h \W$(__git_ps1 " (%s)")]\$ '
    fi

  4. @ivanoats ivanoats revised this gist Jan 30, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -4,7 +4,7 @@ Run the following to create `~/.git-completion.bash`:

    and `~/.git-prompt.sh`:

    curl https://raw.github.com/git/git/master/contrib/completion/git-prompt.sh > ~/.git-completion.bash
    curl https://raw.github.com/git/git/master/contrib/completion/git-prompt.sh > ~/.git-prompt.bash


    Then add the following to your `~/.bashrc` or `~/.bash_profile` after `PATH`:
  5. @ivanoats ivanoats revised this gist Jan 30, 2013. 1 changed file with 8 additions and 14 deletions.
    22 changes: 8 additions & 14 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,11 @@
    Run the following to create `~/.git-completion.bash`:

    curl https://raw.github.com/git/git/master/contrib/completion/git-completion.bash > ~/.git-completion.bash

    and `~/.git-prompt.sh`:

    curl https://raw.github.com/git/git/master/contrib/completion/git-prompt.sh > ~/.git-completion.bash


    Then add the following to your `~/.bashrc` or `~/.bash_profile` after `PATH`:

    @@ -10,21 +15,10 @@ Then add the following to your `~/.bashrc` or `~/.bash_profile` after `PATH`:
    # Source the git bash completion file
    if [ -f ~/.git-completion.bash ]; then
    source ~/.git-completion.bash
    GIT_PS1_SHOWDIRTYSTATE=true
    GIT_PS1_SHOWSTASHSTATE=true
    GIT_PS1_SHOWUPSTREAM="auto"
    PS1='\t:\[\033[32m\]$(__git_ps1 " (%s)")\[\033[00m\] \W$ '
    source ~/.git-prompt.sh
    PS1='[\u@\h \W$(__git_ps1 " (%s)")]\$ '
    fi

    export PS1

    This will display the branch name next to the folder name in the bash prompt.

    Symbols after the branch name indicate additional information about the repo state:

    * `*`: The branch has modifications
    * `$`: There are stashed changes
    * `=`: The branch is equal with the remote branch
    * `<`: The branch is behind the remote branch (can be fast-forwarded)
    * `>`: The branch is ahead of the remote branch (remote branch can be fast-forwarded)
    * `<>`: The branch and remote branch have diverged (will need merge)
    This will display the branch name next to the folder name in the bash prompt.
  6. @ivanoats ivanoats revised this gist Feb 14, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    Run the following to create `~/.git-completion.bash`:

    curl https://github.com/git/git/raw/master/contrib/completion/git-completion.bash > ~/.git-completion.bash
    curl https://raw.github.com/git/git/master/contrib/completion/git-completion.bash > ~/.git-completion.bash

    Then add the following to your `~/.bashrc` or `~/.bash_profile` after `PATH`:

  7. @parndt parndt revised this gist May 6, 2011. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -13,7 +13,7 @@ Then add the following to your `~/.bashrc` or `~/.bash_profile` after `PATH`:
    GIT_PS1_SHOWDIRTYSTATE=true
    GIT_PS1_SHOWSTASHSTATE=true
    GIT_PS1_SHOWUPSTREAM="auto"
    PS1='\t:\[\033[32m\]$(__git_ps1 " (%s)")\[\033[00m\]\W$ '
    PS1='\t:\[\033[32m\]$(__git_ps1 " (%s)")\[\033[00m\] \W$ '
    fi

    export PS1
  8. @parndt parndt revised this gist May 6, 2011. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -5,15 +5,15 @@ Run the following to create `~/.git-completion.bash`:
    Then add the following to your `~/.bashrc` or `~/.bash_profile` after `PATH`:

    # Set the base PS1
    PS1="\h:\W \u\$ "
    export PS1="\t: \W$ "

    # Source the git bash completion file
    if [ -f ~/.git-completion.bash ]; then
    source ~/.git-completion.bash
    GIT_PS1_SHOWDIRTYSTATE=true
    GIT_PS1_SHOWSTASHSTATE=true
    GIT_PS1_SHOWUPSTREAM="auto"
    PS1='\h:\[\033[32m\]$(__git_ps1 " (%s)")\[\033[00m\]\W \u\$ '
    PS1='\t:\[\033[32m\]$(__git_ps1 " (%s)")\[\033[00m\]\W$ '
    fi

    export PS1
  9. @mhaylock mhaylock created this gist May 6, 2011.
    30 changes: 30 additions & 0 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,30 @@
    Run the following to create `~/.git-completion.bash`:

    curl https://github.com/git/git/raw/master/contrib/completion/git-completion.bash > ~/.git-completion.bash

    Then add the following to your `~/.bashrc` or `~/.bash_profile` after `PATH`:

    # Set the base PS1
    PS1="\h:\W \u\$ "

    # Source the git bash completion file
    if [ -f ~/.git-completion.bash ]; then
    source ~/.git-completion.bash
    GIT_PS1_SHOWDIRTYSTATE=true
    GIT_PS1_SHOWSTASHSTATE=true
    GIT_PS1_SHOWUPSTREAM="auto"
    PS1='\h:\[\033[32m\]$(__git_ps1 " (%s)")\[\033[00m\]\W \u\$ '
    fi

    export PS1

    This will display the branch name next to the folder name in the bash prompt.

    Symbols after the branch name indicate additional information about the repo state:

    * `*`: The branch has modifications
    * `$`: There are stashed changes
    * `=`: The branch is equal with the remote branch
    * `<`: The branch is behind the remote branch (can be fast-forwarded)
    * `>`: The branch is ahead of the remote branch (remote branch can be fast-forwarded)
    * `<>`: The branch and remote branch have diverged (will need merge)