orz.conf

技術メモ✍

gitのインストール

windowsubuntuへgitをインストールしました。

windowsはgit for windowsを使用。
下記サイトよりダウンロードします。
Git for Windows

インストール手順
  • Select Components

  Git Bash HereとGit GUI Hereにチェック

  • Adjusting your PATH environment

  Run Git from the Windows Command Promptを選択

  • Configuring the line ending conversions

  Checkout as-is, commit Unix-style line endingsを選択


Ubuntuへのインストールについても記載します。

# apt-get install git-core
# apt-get install git-doc


初期設定です。
ここからはWindowsUbuntuも共通です。
Windowsエクスプローラー上で右クリックするとGit Bashというのが
追加されているのでそれをクリックし起動します。
Ubuntuではターミナル上から設定を行うことが出来ます。

名前とメールアドレスを設定します。

# git config --global user.name "XXXX"
# git config --global user.email "XXXX"

インストールしたgitを試しに使ってみます。
/tmp/testというディレクトリで試してみます。

# cd /tmp/test
# git init

するとディレクトリ内に.gitが出来ます。
test.txtというファイルを作成しgitに登録してみます。

# git add test.txt

状態を確認します。

# git status

コミットしてみます。

# git commit -m "初めてのコミット"

ファイル編集→コミットと繰り返しログを確認します。
ログの確認は

# git log

とりあえず今回はここまで