Tag Archives: Homebrew

Signing Git Commits without Entering Password Using `gpg-agent` and `pinentry-mac` on OS X

Install required packages via Homebrew:

$ brew install gpg gpg-agent pinentry-mac

Edit and add the following lines in ~/.gnupg/gpg-agent.conf:

pinentry-program /usr/local/bin/pinentry-mac

Edit and enable use-agent in ~/.gnupg/gpg.conf:

use-agent

Then add the following line to your shell profile:

eval $(gpg-agent --daemon --sh)

更新 Homebrew 时出现 Error: Failed while executing git pull origin refs/heads/master:refs/remotes/origin/master 的解决方案

病情:

[email protected]:/Users/mom$ brew update
remote: Counting objects: 2482, done.
remote: Compressing objects: 100% (750/750), done.
remote: Total 2105 (delta 1543), reused 1822 (delta 1349)
Receiving objects: 100% (2105/2105), 329.33 KiB | 122 KiB/s, done.
Resolving deltas: 100% (1543/1543), completed with 295 local objects.
From https://github.com/mxcl/homebrew
   f884112..28f7e01  master     -> origin/master
error: The following untracked working tree files would be overwritten by merge:
	Library/Formula/autojump.rb
Please move or remove them before you can merge.
Updating f884112..28f7e01
Aborting
Error: Failed while executing git pull  origin refs/heads/master:refs/remotes/origin/master

解决方法:

cd `brew --prefix`

git clean -n # Does a dry run---shows what will get nuked without touching anything
git clean -f # This will destroy files