LoginSignup
1
1

More than 5 years have passed since last update.

Gitの備忘録

Posted at

筆者は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
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