The return of BASH Friday!!!!
Since my brother Charles keeps busting my balls and I’ve finally come to terms that I’m a lazy asshole – I present the return of everyone’s favorite Friday time waster…. BASH!!!!!!
http://bash.org/?894647
http://bash.org/?894351
http://bash.org/?894350
http://bash.org/?894335
http://bash.org/?894334
http://bash.org/?894043
http://bash.org/?893952
http://bash.org/?893353
http://bash.org/?892979
http://bash.org/?892785
http://bash.org/?892161
http://bash.org/?891290
http://bash.org/?889637
http://bash.org/?887536
http://bash.org/?887444
http://bash.org/?886198
http://bash.org/?885924
http://bash.org/?885012
http://bash.org/?884782
Quote:
That it why i keep rabid ferret in my desk. I find people more responsive to my demands once they meet. Go fig.
Export files from a revision or range of revisions with Git
If there is one thing I miss about using TortoiseSVN was the convinence of exporting a group of files from a revision or range of revisions. Currently I know of no way of doing this in Git, so I decided to roll my own Git alias to accomplish this.
The alias below takes two arguments:
- the revision or range of revision you want to export files from
- the directory you want to place them in
So if you want to export all the changed files from HEAD to HEAD~2 and put them in the /cygdrive/c/temp directory, you would do:
$ git exportfiles HEAD..HEAD~2 '/cygdrive/c/temp'
The code is below:
exportfiles = !sh -c 'git diff $0 --name-only | "while read files; do mkdir -p \"$1/$(dirname $files)\"; cp -vf $files $1/$(dirname $files); done"'
Just cut and paste it into the [alias] portion of you .git/config file and you’re ready to go.
As always, if you have a better solution, please leave it in the comments below.
2 comments