git

ユーザー設定

1 git config --global user.name 'Shinya Koyano'
2 git config --global user.email 'moli_green@runbox.com'
3 git config --global user.signingkey ''

基本的な使い方

 1 git init
 2 
 3 git add .
 4 git commit
 5 
 6 git clone [paht or URI]
 7 
 8 git status
 9 
10 cat .gitignore 
11 *.hoge
12 
13 git diff
14 
15 git mv foo bar
16 
17 git log
18 
19 git pull
20 
21 git push

MacにおけるGPG署名時のエラーについて

コミットしようとすると次のようなエラーになる。

1 error: gpg failed to sign the data fatal: failed to write commit object

Macに入っていたGitを使っていたが、それをやめ、HomebrewのGitを使うようにする。

それでもまだエラーが出るが、メッセージが変化している。

1 gpg: signing failed: Inappropriate ioctl for device

これは~/.zshrcexport GPG_TTY=$(tty)とすることで解決できた。

これによってMacからでも自分のGitサーバーに署名付きでコミットできるようになった。