README.textile

A collection of shell scripts for making pulling, branching, and merging with git fast and painless.

Git sometimes requires typing 2 or 3 commands just to execute something basic like fetching new code. git-friendly adds some new commands – pull, push, branch, merge – which are just simple wrappers around git commands and some post-pull hooks.

Bonus niceties:

push also copies a GitHub compare URL to your clipboard for easy pasting

pull will run commands like bundle install, npm install, yarn install and bower install if applicable

branch will track remote branches if available

relevant commands stash/pop changes as needed

less time fighting git = more time actually doing work

Install

Run this one-liner, which will checkout the latest code & unpack the scripts into /usr/local/bin
If you don’t have write access to /usr/local/bin you’ll need to run this using ‘sudo’

Switch branches or create new local branch if it doesn’t exist. Intelligently sets up remote branch tracking so you can just type ‘git pull’ and not always ‘git pull origin newbranch’. If no argument specified will list all local and remote branches.

merge [name]

Merge the specified branch into the current branch. Rebases first if the branch is local-only

Configuration

You can disable bundle install, npm install, yarn install and bower install for the pull command by defining environmental variables:

GIT_FRIENDLY_NO_BUNDLE: disables bundle install;

GIT_FRIENDLY_NO_NPM: disables npm install;

GIT_FRIENDLY_NO_YARN: disables yarn install;

GIT_FRIENDLY_NO_BOWER: disables bower install;

GIT_FRIENDLY_NO_COMPOSER: disables composer install;

For example, add this line to your ~/.bash_profile to disable bundle install:

I also recommend adding the current git branch to your Terminal prompt (PS1) or you’ll quickly lose your place — here is my pimp_prompt() bash function which goes in your ~/.bash_profile or ~/.bashrc, then type source ~/.bashrc to reload.

License

Code released under an MIT license.

Fork away, do whatever. Pull requests welcome.

Following the practices of Rubinius, anyone who submits an accepted patch is granted a commit bit (write access to the repository).

Following the practices of FAT Lab, anyone who submits an accepted patch is granted credit and attribution bits.