
munakata@muna-E420:~/latex$ cat ~/.ssh/config Host MYTHEN HostName mythen.hmuna.com Port 8823 IdentityFile ~/.ssh/muna_E420 User git
munakata@muna-E420:~/beamer/keio2012$ git config --global user.email public_mail@hmuna.com munakata@muna-E420:~/beamer/keio2012$ git config --global user.name "hisao munakata"
munakata@muna-E420:~/beamer/keio2012$ git init Reinitialized existing Git repository in /home/munakata/beamer/keio2012/.git/ munakata@muna-E420:~/beamer/keio2012$ git add *
munakata@muna-E420:~/beamer/keio2012$ git remote add origin ssh://munakata@mythen.hmuna.com:8823/mnt/raid_vol/home/git/repos/XXX
git branch --set-upstream-to=origin/master master
git log --pretty=format:"%h - %an, %ar : %s" ca82a6d - Scott Chacon, 11 months ago : changed the version number 085bb3b - Scott Chacon, 11 months ago : removed unnecessary test code a11bef0 - Scott Chacon, 11 months ago : first commit
| %H | コミットのハッシュ |
| %h | コミットのハッシュ (短縮版) |
| %T | ツリーのハッシュ |
| %t | ツリーのハッシュ (短縮版) |
| %P | 親のハッシュ |
| %p | 親のハッシュ (短縮版) |
| %an | Author の名前 |
| %ae | Author のメールアドレス |
| %ad | Author の日付 (--date= オプションに従った形式) |
| %ar | Author の相対日付 |
| %cn | Committer の名前 |
| %ce | Committer のメールアドレス |
| %cd | Committer の日付 |
| %cr | Committer の相対日付 |
| %s | 件名 |
munakata@muna-E420:~/beamer/keio2012$ git push e420 master munakata@mythen.hmuna.com's password: Counting objects: 5, done. Delta compression using up to 4 threads. Compressing objects: 100% (3/3), done. Writing objects: 100% (3/3), 337 bytes, done. Total 3 (delta 2), reused 0 (delta 0) To ssh://munakata@mythen.hmuna.com:8823/mnt/raid_vol/home/munakata/repos/keio2012 462fe87..7a936a0 master -> master
これは以下の2つをまとめて実行したことになる
git rm --cached [ファイル名]
git checkout -f abc123 hoge.txt
cat (クライアントの公開鍵)>> ~/.ssh/authorized_keys chmod 600 ~/.ssh/authorized_keys
munakata@muna-E420:~/latex$ cat ~/.ssh/config Host MYTHEN HostName mythen.hmuna.com Port 8823 IdentityFile ~/.ssh/muna_E420 (公開鍵) User munakata
$ ssh-agent bash $ ssh-add ~/.ssh/(秘密鍵)
注:gitサーバーの .ssh のディレクトリーのパーミションが 700 でないと、git push 時に git ユーザーのパスワードを聞かれる(が、git アカウントには対話ログインを許可していないので正しいパスワードを入れても push できない。)
munakata@mythen:~/My_presentations/als2013JP$ git config -l color.ui=auto user.name=hisao munakata user.email=public_mail@hmuna.com core.quotepath=false core.repositoryformatversion=0 core.filemode=true core.bare=false core.logallrefupdates=true remote.origin.fetch=+refs/heads/*:refs/remotes/origin/* remote.origin.url=ssh://munakata@mythen.hmuna.com:8823/mnt/raid_vol/home/munakata/repos/als2013JP branch.master.remote=origin branch.master.merge=refs/heads/master remote.mythen.url=ssh://munakata@mythen.hmuna.com:8823/mnt/raid_vol/home/munakata/repos/als2013JP remote.mythen.fetch=+refs/heads/*:refs/remotes/mythen/*