LoginSignup
3
3

More than 3 years have passed since last update.

homesickでdotfileを管理

Last updated at Posted at 2013-05-08

今まで、リポジトリにdotfileは登録して、お手製のリンクはるスクリプトなどで対応してたけど、便利なツールがあれば使いたいのと同時に、ソロソロdotfileを一回整理して、公開(ほぼ社内向けかも)しようと思っていたので、思い切って導入。

GitHub上にリポジトリを作成

dotfilesという名前のリポジトリを作成します。
他人に知られたらまずい情報を載せる際は、Publicなリポジトリにしないように・・・

homesickでフォルダ使うので、最初に少しリポジトリにファイル作っておく。
どこか適当なフォルダで、以下を実行。

% touch README.md
% git init
% git add README.md
% git commit -m 'first commit'
% git remote add origin git@github.com:masateru/dotfiles.git
% git push -u origin master
% mkdir home
% touch home/.zshenv
% touch home/.zshrc
% git add .
% git commit -m 'add home dir'
% git push

homesickをインストール

% sudo gem install homesick

ファイルの管理

% homesick clone masateru/dotfiles
% homesick symlink masateru/dotfiles

変更があれば、pushしたり、pullしたりすればOKです。

(追記)リモートリポジトリの変更

このままローカルの変更点を、commitしてpushしようとしたところ、以下の様なエラーで怒られた。

% homesick push masateru/dotfiles
    git push
fatal: remote error:
  You can't push to git://github.com/masateru/dotfiles.git
  Use https://github.com/masateru/dotfiles.git

なので、リモートのリポジトリを変更し直して、再度pushすれば、うまくいった。


3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3