git
#ソフトウェア構成管理
#バージョン管理
https://gyazo.com/b1112d4de382df11146890b3a70e22cd
新規リモートリポジトリを作成する時
例:README.mdをcommit & push
echo "sample" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/<username>/<new repository name>.git
git push -u origin master
リモートリポジトリから取得するとき
git clone <url>
masterをcheckoutするとき
git checkout master
ブランチ切るとき
git branch
ローカルブランチ一覧が表示される
git branch <branch name>
ブランチ<branch name>がローカルに作成される
ブランチをcheckoutするとき
git checkout <branch name>
git branch
ローカルブランチ一覧が表示される
commitするとき
git status
git diff
git add <file>
<file>をcommit対象に追加
git status
git commit
ローカルリポジトリに反映
stagingした状態
git status
git push origin master
リモートリポジトリに反映
git log
ブランチをmasterにマージするとき
git checkout master
リモートリポジトリからmasterを取得
git merge <branch name>
マージを実行
git push origin master
リモートリポジトリに反映
その他コマンド(そのうち書く)
git rebase
git reset
git revert
git cherry-pick
References:
https://git-scm.com/
https://qiita.com/yuyakato/items/41751848add5dfd5289c
https://github.com/jlord/git-it-electron/releases
https://www.kaitoy.xyz/tags/git/
http://keijinsonyaban.blogspot.com/2010/10/a-successful-git-branching-model.html
https://myenigma.hatenablog.com/entry/2019/08/03/204428