git コマンド(個人的によく使うやつまとめ)
随時、変更や追記あり ふんわりとしか覚えてません
# リポジトリを作成 $ git init # コミット $ git commit -m “commit内容” # プッシュ $ git push -u origin 反映させたいbranch名 # 自分のリモート(origin)のmasterブランチからpull $ git pull origin master # ブランチ作成 $ git branch 作りたいブランチ名 # ブランチを移動 $ git checkout 移動したいブランチ名 # ローカルブランチを消す $ git branch -d 削除したいブランチ名 # コミット一覧 $git log # ローカルブランチ一覧 $git branch # コミットするファイルとして、現在のディレクトリ以下の全てのディレクトリ、ファイルを指定 $ git add .git # addとコミットを同時に行う場合 $ git commit -a -m “commit内容” # フォーク元から自分のローカルに反映 $ git fetch upstream $ git merge upstream/master # 上二つをまとめて $git pull upstream master # 変更されたファイルの一覧を出す $ git status # コミットするステージに上げる $ git add ファイルパス # upstreamとかoriginが何かを確認する $ cat ./.git/config # こっちも上と似たような感じの $ git config --local -l # originとかupstreamのURLを確認する(リモート) $ git remote -v # バッシュの書き換えとか $ vim ~/.bash_profile #入力 i # 終わったら Esc :qw sift+z sift+z