ablog

不器用で落着きのない技術者のメモ

github にリポジトリを作成したのと別のマシンからファイルを作成したり削除したりする

githubリポジトリを作成したのと別のマシンからファイルを作成したり削除したりしようとしたけど、ローカルリポジトリは変更できるが、github に同期できないので、一旦ローカルリポジトリを削除してやり直してみた。

$ cd /cygdrive/c
$ rm -fr git
$ mkdir git
$ cd git
$ git init
$ git clone git://github.com/yoheia/yoheia.git
  • テストファイルを作成して github に同期してみる。
$ cd yoheia
$ echo aaa > a
$ git add a
$ git commit -m'test'
$ git push git@github.com:yoheia/yoheia.git master
  • テストファイルを削除して github に同期してみる。
$ git rm a
$ git commit -m'dlete test file'
$ git push git@github.com:yoheia/yoheia.git master


追記:
編集する場合も add して commit するぽい。

  • emacs を編集する。
  • commit して github に同期する。
$ git add .emacs
$ git commit -m'modified return code in shell-mode'
[master]: created e22152f: "modified return code in shell-mode"
 1 files changed, 3 insertions(+), 2 deletions(-)
$ git push git@github.com:yoheia/yoheia.git master
Counting objects: 7, done.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 472 bytes, done.
Total 4 (delta 1), reused 0 (delta 0)
To git@github.com:yoheia/yoheia.git
   b711487..e22152f  master -> master

*1:タイムラグかキャッシュかわからないが操作後すぐ見ても変わってないことがある。

Meadow から Cygwin を使う設定

github を使うために Cygwin をインストールしたので、Meadow3 から Cygwin を使う設定をしてみた。

C:\cygwin\bin;c:\cygwin\sbin;C:\cygwin\usr\sbin;C:\cygwin\usr\bin;C:\cygwin\usr\local\bin;
  • .emacs に以下を追加する。
;;Cygwin
(setq explicit-shell-file-name "bash.exe")
(setq shell-file-name "sh.exe")
(setq shell-command-switch "-c")
(modify-coding-system-alist 'process ".*sh\\.exe" '(undecided-dos . euc-jp-unix))
;; argument-editing の設定
(require 'mw32script)
(mw32script-init)
(setq exec-suffix-list '(".exe" ".sh" ".pl"))
(setq shell-file-name-chars "~/A-Za-z0-9_^$!#%&{}@`'.:()-")


[補足]
http://www.bookshelf.jp/soft/meadow_9.html#SEC50 には

(modify-coding-system-alist 'process ".*sh\\.exe" '(undecided-dos . euc-japan))

と記述されていたが、

M-x shell

として shell-mode を使うと、

bash-3.2$ 
bash: $'\r': command not found
bash-3.2$ 
bash: $'\r': command not found
...

キーを押すたびに「'\r': command not found」と怒られるので、

(modify-coding-system-alist 'process ".*sh\\.exe" '(undecided-dos . euc-jp-unix))

に変更した。


[参考]
http://www.bookshelf.jp/soft/meadow_9.html#SEC50