2018-06-26

Git メモ

git は一生使わない宣言をして1年半、そろそろ使わないでは済まされなくなってきました。あはは。
https://twitter.com/e_toyoda/status/803016345264586753

・レポジトリの作り方はわからないが、 github でポチポチやっていればできる。

 (svn import はいまだに使い方を間違えてレポジトリをグチャグチャにするのでこういうのは助かる)

・手元に持ってくる

 $ git clone https://github.com/etoyoda/foo

・自分の名前の設定

 $ git config --global user.email foo@example.com
 $ git config --global user.name "TOYODA Eizi"
 $ git config --global credential.https://github.com.username etoyoda

・手元のファイルを書き換えたらすぐ投入するなら

 $ git pull
 $ vi ...
 $ EDITOR=vi git commit -a
 $ git push

・ブランチ切ってマージするなら

 $ git branch oresama
 $ git checkout oresama
 $ vi ...
 $ EDITOR=vi git commit -a
 $ git push --set-upstream origin oresama  #こうしろと言われる
 $ git checkout master
 $ git merge oresama
 $ git push

0 件のコメント:

コメントを投稿