LoginSignup
1
1

More than 5 years have passed since last update.

Gitについて

Last updated at Posted at 2015-08-13

初期設定

$ 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 <エディタのパス>
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1