筆者はGitHubは「ブラウザで動かせるじゃん」といって
gitコマンドなど使っていませんでした...
ということで備忘録。
ダウンロード
git clone
だけど、depth指定をしないと遅くなる。基本:
git clone --depth 10 https://github.com/XXXXXXXXXXXXX/XXXXXXXXXXXXX.git
ブランチ指定
誤:
git clone --depth 10 https://github.com/XXXXXXXXXXXXX/XXXXXXXXXXXXX/blob/master.git
正:
git clone --branch master --depth 10 https://github.com/XXXXXXXXXXXXX/XXXXXXXXXXXXX.git
ブランチを作る
git branch develop
ブランチを移動する
git checkout develop
差分
要注意: Ctrl-Cで終了するとlessが終了しないので必ずq
で終了すること。
git diff
コミット
git commit -a -m "summary"
Push
git push origin develop
書込権限ないのでPull Requestを出したいとき
git push https://github.com/MyAccount/xxxxxxx.git develop