なんだこれは

はてなダイアリーから移転しました。

github に SKK-JISYO.slang を公開したときのメモ

githubSKK-JISYO.slang を公開しました。

gitに不慣れなのでちょっと失敗してしまっていろいろしたので、そのときのメモ。
git は mac のもの

git --version

git version 1.8.3.4 (Apple Git-47)

ローカルにディレクトリを作成

mkdir SKK-JISYO.slang
cd SKK-JISYO.slang/
ls

LICENSE README SKK-JISYO.slang

ファイルを登録

git add README LICENSE SKK-JISYO.slang
git commit -m 'firs commit'

[master 21a61ed] first commit
3 files changed, 34654 insertions(+)
create mode 100644 LICENSE
create mode 100644 README
create mode 100644 SKK-JISYO.slang

リモートに登録

git remote add origin https://github.com/fu7mu4/SKK-JISYO.slang.git

fatal: remote origin already exists.

github に登録しようとして失敗

git remote add https://github.com/fu7mu4/SKK-JISYO.slang.git

usage: git remote add []

-f, --fetch fetch the remote branches
--tags import all tags and associated objects when fetching
or do not fetch any tag at all (--no-tags)
-t, --track branch(es) to track
-m, --master
master branch
--mirror[=]
set up remote as a mirror to push to or fetch from

githubの方と origin がかぶってしまったらしいので、release に変更してみる

git remote add release https://github.com/fu7mu4/SKK-JISYO.slang.git

これでプッシュ。

git push release master

Counting objects: 6, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (5/5), done.
Writing objects: 100% (5/5), 444.54 KiB | 0 bytes/s, done.
Total 5 (delta 0), reused 0 (delta 0)
To https://github.com/fu7mu4/SKK-JISYO.slang.git
49a45e2..21a61ed master -> master

ここでファイルを編集

状態確認

git log

commit 21a61edb3f80936ad768c2f1b403122e595f85ef
Author: fu7mu4
Date: Sat Nov 23 17:11:18 2013 +0900

first commit

commit 49a45e28e28730fb48c3b92183e55dbf1b1146bb
Author: fu7mu4
Date: Sat Nov 23 17:06:21 2013 +0900

del

commit 0e60dafc510ded435420bb0370902c4275bcc9cd
Author: fu7mu4
Date: Sat Nov 23 17:06:02 2013 +0900

del

commit 8d5f6baeb4f35982fd1966e12f06445260abd22b
Author: fu7mu4
Date: Fri Nov 22 23:12:53 2013 -0800

Initial commit

git status

# On branch master
# Your branch is ahead of 'origin/master' by 1 commit.
# (use "git push" to publish your local commits)
#
# Changes not staged for commit:
# (use "git add ..." to update what will be committed)
# (use "git checkout -- ..." to discard changes in working directory)
#
# modified: README
# modified: SKK-JISYO.slang
#
# Untracked files:
# (use "git add ..." to include in what will be committed)
#
# slangold
no changes added to commit (use "git add" and/or "git commit -a")

以前登録したファイルで変更があったファイルの変更を登録(add)

git add README SKK-JISYO.slang
git status

# On branch master
# Your branch is ahead of 'origin/master' by 1 commit.
# (use "git push" to publish your local commits)
#
# Changes to be committed:
# (use "git reset HEAD ..." to unstage)
#
# modified: README
# modified: SKK-JISYO.slang
#
# Untracked files:
# (use "git add ..." to include in what will be committed)
#
# slangold

同ファイルの変更をコミット

git commit -m 'small fix'

[master 62f0ce8] small fix
2 files changed, 46 insertions(+), 94 deletions(-)

git status

# On branch master
# Your branch is ahead of 'origin/master' by 2 commits.
# (use "git push" to publish your local commits)
#
# Untracked files:
# (use "git add ..." to include in what will be committed)
#
# slangold
nothing added to commit but untracked files present (use "git add" to track)

コミット内容を リモートへ push。

git push

warning: push.default is unset; its implicit value is changing in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the current behavior after the default changes, use:

git config --global push.default matching

To squelch this message and adopt the new behavior now, use:

git config --global push.default simple

See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)

Counting objects: 7, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 1.15 KiB | 0 bytes/s, done.
Total 4 (delta 2), reused 0 (delta 0)
To https://github.com/fu7mu4/SKK-JISYO.slang.git
21a61ed..62f0ce8 master -> master

デフォルトのpush先が決まってないという警告がでているが、そのまま github へ push しているようだ。