あじちゃんの備忘録。

〜ここはメモ帳です

開発の初期フォルダ設定 / Git の Local 設定

初期状態のmacに開発環境を構築する時、最初にプロジェクトを置くフォルダを作ると思います。その時のディレクトリ名とか諸々の設定のメモです。



ルートディレクトへ移動。ここに開発用フォルダを作ります。

$ cd ~

$ ls


Applications Documents Library Music Public
Desktop Downloads Movies Pictures

 

フォルダ名は htdocs にします。

私もよくわかってないのですが、ドキュメントルートを指すと思っていてHypertext Documentsの略でもあります。

(私がweb系の開発をする人間なので伝聞でこういう名前にしただけです...)

$ mkdir ~/htdocs

私の場合この下に、会社用と個人用でディレクトリをさらに分けますが考えないでいい人はこのまま進みます

 

考えないでいい人

  1. ディレクトリを移動します

$ cd htdocs

 

  1. Git を入れます

$ git init

 

  1. Git 設定を確認します

$ git config -l

core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
core.ignorecase=true
core.precomposeunicode=true

多分こんな感じの出力がされると思います

 

  1. Global にユーザの設定を追加します

$ git config user.name {your user name}
$ git config user.email {your user mail}

 

  1. 設定を確認します

$ git config -l

core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
core.ignorecase=true
core.precomposeunicode=true
user.name={your user name}
user.email={your user mail}

多分こんな感じの出力がされると思います

user.name と user.email が指定したものになっていれば問題ありません

 

あとは、自分のGitリポジトリから諸々 clone するなりなんなりでOKです。

 

考えなきゃいけない人

  1. ディレクトリを移動します

$ cd htdocs

 

  1. ディレクトリを複数に分けます

$ mkdir SelfProject
$ mkdir WorkProject

 

  1. それぞれのディレクトリに Git を入れます

$ cd SelfProject

$ git init


$ cd WorkProject

$ git init

 

  1. それぞれのディレクトリでGit 設定を確認します

$ git config -l

core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
core.ignorecase=true
core.precomposeunicode=true

多分こんな感じの出力がされると思います

 

  1. Local にユーザの設定を追加します  各ディレクトリで以下のように行います

$ git config --local user.name {your user name}
$ git config --local user.email {your user mail}

 

  1. ディレクトリで設定を確認します

$ git config -l


credential.helper=osxkeychain
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
core.ignorecase=true
core.precomposeunicode=true
user.name={your user name}
user.email={your user mail}

多分こんな感じの出力がされると思います

user.name と user.email がそれぞれ指定したものになっていれば問題ありません

 

  1. htdocs ディレクトリで Git 設定を確認します

$ git config -l


credential.helper=osxkeychain

こんな感じで、特定のユーザが指定されていなければOKです

あとは、各ディレクトリでそれぞれの Git リポジトリから諸々 clone するなりなんなりでOKです。