Help us understand the problem. What is going on with this article?

homesick を使って dotfiles を管理する!

More than 5 years have passed since last update.

install homesick

$ gem install homesick

GitHub に dotfiles リポジトリ作成

  • GitHub で dotfiles リポジトリを作成してください。

  • ローカルに dotfiles を作成します。

$ mkdir ~/dotfiles 
$ cd ~/dotfiles
$ git init
Initialized empty Git repository in /Users/user_name/dotfiles/.git/

$ mkdir home 
$ cd home
$ cp ~/.vimrc . 
$ cp ~/.zshrc .
  • 作った dotfiles リポジトリに push
$ git add .
$ git commit -m 'Initial commit'
$ git push -u origin master

作った dotfiles を homesick で設置する

  • 作ったリポジトリを homesick clone で GitHub から clone
$ homesick clone user_name/dotfiles
git clone  https://github.com/user_name/dotfiles.git to /Users/user_name/.homesick/repos/dotfiles
  • シンボリックリンクを貼る
$ cd ~ 
$ homesick symlink dotfiles 
  • こんな感じになれば OK !!
$ ls -al
*** .agignore -> /home/webuser/.homesick/repos/dotfiles/home/.agignore
*** .bashrc -> /home/webuser/.homesick/repos/dotfiles/home/.bashrc
*** .gitconfig -> /home/webuser/.homesick/repos/dotfiles/home/.gitconfig
*** .vimrc -> /home/webuser/.homesick/repos/dotfiles/home/.vimrc
*
*
*

dotfiles を 更新した時!!

$ homesick pull dotfiles
$ homesick symlink dotfiles

おしゃんてぃ。。

もし下記のエラーメッセージを言われたら。。。

Cannot pull with rebase: You have unstaged changes.
Please commit or stash them.

こんな感じで対処してください。

cd ~/.homesick/repos/dotfiles
git add .
git stash save
homesick pull dotfiles
homesick symlink dotfiles
git stash pop
septeni-original
技術を磨き続けることでネットサービスを軸とした新たな体験を世界に提供します。
http://www.septeni-original.co.jp/index.html
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした