
gitコマンド checkoutとswitchの違い ~これからはswitchを使おう~
git switchコマンドとは git switchコマンドはブランチの切り替えを専用に行うコマンドでバージョン2.23でリリースされました。 git switchコマンドがリリースされるまではgit のブランチの切り替えにはchecko ...

gitコマンドの使い方 ~ git revert ~
git revert コマンド概要 git revertは特定のcommitの内容を取り消したい場合に、逆向きの変更を加えたcommitを作成するコマンドです。 commitを取り消すコマンドには他にgit resetコマンドがありますが、 ...

gitコマンドの使い方 ~ git push ~
git push コマンド概要 git pushはlocal-repository(ローカルリポジトリ)のブランチが示すcommitをremoto-repository(リモートリポジトリ)に反映するコマンドです。 また、remo ...

gitコマンドの使い方 ~ git pull ~
git pull コマンド概要 git pullはremoto-repository(リモートリポジトリ)のデフォルトブランチが示すcommitから遡って取得したcommitをlocal-repository(ローカルリポジトリ) ...

gitコマンドの使い方 ~ git fetch ~
git fetch コマンド概要 git fetchはremoto-repository(リモートリポジトリ)のデフォルトブランチが示すcommitから遡って取得したcommitをlocal-repository(ローカルリポジト ...

gitコマンドの使い方 ~ git clone ~
git reset コマンド概要 git cloneは以下の3つの処理を行うコマンドです。 remoto-repository(リモートリポジトリ)のcommitツリーを元にlocal-repository(ローカルリポジトリ)を ...

gitコマンドの使い方 ~ git reset ~
git reset コマンド概要 git resetは以下の3つの処理を行うもので、指定するオプション(soft/mixed/hard)によって処理される内容が変わります。 処理内容softmixedhardHEADの位置を変更○ ...

gitコマンドの使い方 ~ git checkout ~
git checkout コマンド概要 git checkoutコマンドの基本的な使い方は、指定したcommitのディレクトリ(treeオブジェクト)およびファイル(blobオブジェクト)をstaging-area(ステージングエ ...

gitコマンドの使い方 ~ git stash ~
git stash コマンド概要 stashとはcommitを作成する前の変更内容を一時保存するコマンドです。 stashのリスト表示 git stash list 作成したstashを一覧で表示します。 (master) $ git st ...

gitコマンドの使い方 ~ git tag ~
git tag コマンド概要 タグ(tag)とは特定のcommitに名前を付けたものです。 リリースのタイミングで付与するなどの利用方法があります。 git tagはタグに対して以下の操作をするコマンドです。 タグ(tag)の表示 ...

gitコマンドの使い方 ~ git branch ~
git branch コマンド概要 git branchはローカルリポジトリのブランチに対して以下の操作をするコマンドです。 ブランチのリスト表示ブランチの作成ブランチの削除upstream(上流ブランチ)の設定upstream( ...

gitコマンドの使い方 ~ git cat-file ~
git cat-file コマンド概要 git cat-fileはリポジトリに登録されている以下のオブジェクトの内容を表示するコマンドです。 commitオブジェクトtreeオブジェクトblobオブジェクトtagオブジェクト 以下 ...

gitコマンドの使い方 ~ git cherry-pick ~
git cherry-pick コマンド概要 git cherry-pick コマンドは特定のcommitの変更内容だけを取り込んで新しいcommitを作成します。 以下の図はmasterブランチでcommit(C)をc ...

gitコマンドの使い方 ~ git rebase ~
git rebase コマンド概要 git rebase コマンドには以下の2つの機能があります。 2つのcommitの履歴を一直線にする複数のcommitを1つのcommitにまとめる 共通していることは、commit ...

gitコマンドの使い方 ~ git merge ~
git merge コマンド概要 git merge コマンドはcheckout中のブランチに対して、指定したブランチの内容を取り込み新しいcommitを作成します。 以下は、masterブランチにdevelopブランチ ...

gitコマンドの使い方 ~ git commit ~
git commit コマンド概要 git commit コマンドは次の2つのオブジェクトを作成しリポジトリに登録するコマンドです。 treeオブジェクト:ディレクトリの情報commitオブジェクト:blobオブジェクト ...

gitコマンドの使い方 ~ git rm ~
git rm コマンド概要 git rm コマンドは以下の2つの処理を行います。 1. staging-area(ステージングエリア)のインデックスに登録されたファイル情報を削除する2. working-director ...

gitコマンドの使い方 ~ git ls-files ~
git ls-files コマンド概要 git ls-filesコマンドはstaging-area(ステージングエリア)でインデックスされているファイルを確認したい場合に利用するコマンドです。 ディレクトリパスを含むファイルパスの一覧を表示 ...

gitコマンドの使い方 ~ git add ~
git add コマンド概要 git addを簡単に説明すると「ステージングエリア(インデックス)に追加する」となるのですが、もう少し具体的に理解しておくと、その他のコマンドについても理解が進みやすくなります。 git addは以下の2つの ...