pbcopy & pbpaste for windows git bash

pbcopy and pbpaste where great on mac's terminal, but they're not on windows command line prompt or git bash.

Here's some lines to paste in your ~/.bash_profile to get pbcopy and pbpaste on windows git bash

function pbpaste {
    cat /dev/clipboard
}

function pbcopy {
    piped_data=""
    while read data; do
        piped_data="${piped_data}\n${data}"
    done
    echo -e $piped_data > /dev/clipboard
}