githubを利用して、Linuxの.vimrcや.vimディレクトリを管理
2011年11月30日githubを利用して、Linuxの.vimrcや.vimディレクトリを管理
表題のままなんですが、githubを利用してみたのでそのメモ。
- githubアカウントの作成
githubのサインアップを行います
今回は、無料登録しました。 - リポジトリの作成
Create Repositoryのリンクから、リポジトリを作成します
作成すると、以下のようなチュートリアルが表示されるので、参考にしつつ作業を進めますGlobal setup:
Set up git
git config --global user.name "user name"
git config --global user.email email@example.comNext steps:
mkdir vimscript
cd vimscript
git init
touch README
git add README
git commit -m 'first commit'
git remote add origin git@github.com:username/repository.git
git push -u origin masterExisting Git Repo?
cd existing_git_repo
git remote add origin git@github.com:username/repository.git
git push -u origin masterImporting a Subversion Repo?
Click hereWhen you're done:
Continue - コミットユーザ情報の設定
チュートリアルにしたがって、コミットユーザの情報を設定します
$ git config --global user.name "username" $ git config --global user.email email@example.com
- 作業ディレクトリの初期化とコミット(push)
チュートリアルでは、READMEとなってますが、githubはMarkdown記法もサポートしているので、README.mkdを作成します
「git add」で追加後、「git commit」でコミットになります
また、「git push」で設定されたremoteへpushします$ git init $ touch README.mkd $ git add README.mkd $ git commit -m 'add readme' $ git remote add origin git@github.com:username/repository.git $ git push -u origin master
- ファイルの追加とpush
リポジトリへ無事pushされていたので、順次ファイルを追加
$ cd $ git add .vimrc $ git add .bashrc $ git add .bash_profile $ git commit -m 'add' $ git push -u origin master