关于Git

最初的设定

$ 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
# 無視したいフォルダ、ファイルの名前、パターンを登録
# 保存

分支 zhī)

# 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 <エディタのパス>
bannerAds