-branch:作業の流れを分けること
mainでは作業しない、自分のbranchで作業する
-commit:変更内容を保存すること
-push:ローカルの変更をサーバーに送ること
-pull:サーバーの最新の状態を取り込むこと
Git Bashを使う
commit->pull->push
自分のコードをpushする前に、チーム員が作業したコードをpullする。
似てるように見えるけど違うもの
git merge main vs git merge origin mainの違い
自分のPC(ローカル)にある mainを合わせるか、サーバーにある最新のmainを合わせるかの違いです。
git checkout vs git switchの違い
branch転換:
git checkout branch vs git switch branch(ほぼ同じ)
branch生成+転換:
git checkout -b branch vs git switch -c branch
そしてgit checkout 機能はgit restoreと同じ
機能の意図を明確にするため、最近はgit checkoutの代わりにgit switchとgit restoreを使っています。
