master / $ git add / $ git commit

「プログラミング」及び「開発」関連用語集

カテゴリー: バージョン管理システム  閲覧数:273 配信日:2019-06-23 10:38



master


最初にリポジトリを作成すると出来るデフォルトのブランチ名

$ git add


ワーキングツリー上で編集および追加したファイルをステージング環境へ追加する
・コミットをする前に、どのファイルをコミットするか指定するため git add する
・addされたファイルはステージ領域(インデックス)というコミット待ちの領域へ追加される
$ git add -A
warning: adding embedded git repository: GitHubリポジトリ名
hint: You've added another git repository inside your current repository.
hint: Clones of the outer repository will not contain the contents of
hint: the embedded repository and will not know how to obtain it.
hint: If you meant to add a submodule, use:
hint:
hint:   git submodule add <url> GitHubリポジトリ名
hint:
hint: If you added this path by mistake, you can remove it from the
hint: index with:
hint:
hint:   git rm --cached GitHubリポジトリ名
hint:
hint: See "git help submodule" for more information.


$ git commit


データ差分をローカルリポジトリへ登録する
作業フォルダー内のファイルをバージョン管理するために、ファイル追加や編集、削除等の操作によるデータの差分をローカルリポジトリへ登録する

コミットを行うためには?
その前にステージ(Index)エリアへ登録する必要がある

ローカルコミットを実行する

-mオプション
・新規コミット作成する
・""(ダブルクォテーション)内にはコミットメッセージを記載する
$ git commit -m "first commit"
[master (root-commit) b39494a] first commit
1 file changed, 1 insertion(+)
create mode 160000 P46