gitのリポジトリをローカルに作る
バージョン管理したいけどGithubに上げたり外のgit-serverに投げるまでも無いな.. って時
git コマンドが使えれば、サーバでリポジトリ作る方法と同じやり方で出来た
環境: Win7Pro, OS X El Capitan
# リポジトリ置きたいところまで移動して
# リポジトリ名のフォルダを作る (例ではホームディレクトリに直接作る)
mkdir ~/SampleRepo
# 移動して、
cd ~/SampleRepo/
# 初期化
git init --bare
# 成功すると Git のコンソールだと BARE:master とか出てるかも知れない
後はここに対して remote add して普通にpush
# 管理したいプロジェクト (今回は別の所に作ったSampleRepo) でいつもの.
# file:// を使って先ほどのリポジトリを指定 (例はWindowsで)
git remote add origin file:///C:/Users/$ユーザ名/SampleRepo
git push -u origin master
もし外でも管理してるなら、リモートリポジトリの名前を変えたほうが安全
git remote add origin を
git remote add local とか
で、
git push -u local master
とても楽しい
ではでは