初期設定
$ git config --global user.name "skyzhao"
$ git config --global user.email "skyzhao@example.com"
# 日本語文字化け対応
$ git config --global core.quotepath false
Git基本
ポジトリ作成
#新規作成
$ git init
#既存クローン
$ git clone git_url
ファイル操作
# ファイルの登録
$ git add .
$ git add fileName
$ git commit -m "comment 1 row " -m "comment2 2 row"
# ファイルの削除
* git rm <削除したいファイル>
* git rm -r <削除したいディレクトリ>
# ファイルの名前変更
* git mv fileName1 fileName2
# 変更を取り消す
* git reset --hard HEAD
無視ファイルの設定
$ touch .gitignore
$ vi .gitignore
# 無視したいフォルダ、ファイルの名前、パターンを登録
# 保存
branch
# list branch
$ git branch
# add branch
$ git branch <newBranch>
# remove branch
$ git branch -d <branchName>
その他
- git status
- git log
- git show <ログID前6位?>
- git config --global core.editor <エディタのパス>