github

Feedjack に手を入れるなら github 使ってみたれ。以下は使い方の備忘録

最初に

リポジトリを作った。以下のガイドが表示されている。

Global setup:

  git config --global user.email yamanetoshi@gmail.com
      

Next steps:

  mkdir feedjack_folk
  cd feedjack_folk
  git init
  touch README
  git add README
  git commit -m 'first commit'
  git remote add origin git@github.com:yamanetoshi/feedjack_folk.git
  git push origin master
      

Existing Git Repo?

  cd existing_git_repo
  git remote add origin git@github.com:yamanetoshi/feedjack_folk.git
  git push origin master
      

When you're done:

  Continue

そりゃええんだが、端末に git って入っとるのかいな。

$ dpkg --get-selections|grep git
git                                             install
$ 

一応 OK と見てええんかなぁ。

$ git --version

git, the filemanager with GNU Interactive Tools, is now called gitfm.

あら? なんか違うぞ。直後の出力に以下なソレが

If you are looking for git, Linus Torvald's content tracker, install
the cogito and git-core packages and see README.Debian and git(7).

うーん、git-core かなぁ。

# apt-get install -fy git-core
(ry
# apt-get remove git 
$ 

で、順にヤッてみる。

$ git config --global  user.email yamanetoshi@gmail.com
git: 'config' is not a git-command

(ry
$

とほほほ。git-email も入れてみる。

# apt-get install git-email -fy
(ry
#

でも git config はケられる。ちなみにバージョンは、というと

$ git --version
git version 1.4.4.4
$

との事。バージョンの問題と見て backports から云々。/etc/apt/sources.list に以下を追加して

deb http://www.backports.org/debian etch-backports main contrib non-free

あとは以下で OK??

# apt-get update
# apt-get -t etch-backports install git-core -s
Reading package lists... Done
Building dependency tree... Done
The following extra packages will be installed:
  git-email
Suggested packages:
  git-doc git-arch git-cvs git-svn git-daemon-run git-gui gitk gitweb
Recommended packages:
  rsync curl
The following packages will be upgraded:
  git-core git-email
2 upgraded, 0 newly installed, 0 to remove and 99 not upgraded.
Inst git-email [1:1.4.4.4-2] (1:1.5.5.1-1~bpo40+1 Backports.org archive:etch-backports) []
Inst git-core [1:1.4.4.4-2] (1:1.5.5.1-1~bpo40+1 Backports.org archive:etch-backports)
Conf git-core (1:1.5.5.1-1~bpo40+1 Backports.org archive:etch-backports)
#

をー。ってコトで入れる。で、以下

$ git config --global user.email yamanetoshi@gmail.com
$ cat .gitconfig
[user]
        email = yamanetoshi@gmail.com
$

いやはや。

続き

メシ食って続きに着手。とりあえず既存のナニを add せんといかんのですが、ブッツケでヤッてみます。

$ mkdir feedjack_folk
$ cd feedjack_folk
$ git init
Initialized empty Git repository in .git/
$ cp ../Feedjack-0.9.12/* . -r
$ git add `find`
$ git commit -m 'first commit'
(ry
$

一応なんとかなってる模様。ここまではまだローカルでのソレな模様。

$ git remote add origin git@github.com:yamanetoshi/feedjack_folk.git
$ git push origin master
(ry
Enter passphrase for key '/home/rms/.ssh/id_rsa': 
Enter passphrase for key '/home/rms/.ssh/id_rsa': 
Enter passphrase for key '/home/rms/.ssh/id_rsa': 
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
$

げ。パスフレーズ忘れた。(馬鹿

あら?

パスフレーズ間違えた訳ではなさげ。remote 側への push ができぬ。とりあえず ssh なコネクションがきちんと張れないのは分かってるのですが ...
なんか適当に作った記憶があるんでもっかい作る。

$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/rms/.ssh/id_rsa): 
Created directory '/home/rms/.ssh'.
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /home/rms/.ssh/id_rsa.
Your public key has been saved in /home/rms/.ssh/id_rsa.pub.
The key fingerprint is:
49:49:fa:05:cc:ac:5b:92:01:fa:6f:dd:ee:dc:4e:f6 rms@debian
$

で、向こう様に登録後、リトライ。

$ git push origin master
The authenticity of host 'github.com (65.74.177.129)' can't be established.
RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'github.com,65.74.177.129' (RSA) to the list of known hosts.
Enter passphrase for key '/home/rms/.ssh/id_rsa': 
Counting objects: 78, done.
Compressing objects: 100% (66/66), done.
Writing objects: 100% (78/78), 49.32 KiB, done.
Total 78 (delta 4), reused 0 (delta 0)
To git@github.com:yamanetoshi/feedjack_folk.git
 * [new branch]      master -> master
$

できたし (鬱

変更したらすること

$ git add file

ここで add する file の記述は .git があるディレクトリからの相対パスで良いのでしょうか。

  • ファイル削除は git rm
  • git diff -cached でローカルな差分
  • git diff だとリポジトリとの差分
  • git commit でナニ

とりあえず変更を盛り込むのですが試験が大変。いちおう変更盛り込んで試験ができた後の commit 後に場所はナニしますが、ここ見てれば探すの簡単なハズ (何