計算機科学のブログ

ほしい物リスト

Git - GitHub - Collaborating with Git - Part Ⅰ: Remote Work - branch, add, commit

Head First Git: A Learner’s Guide to Understanding Git from the Inside OutRaju Gandhi(著)、 O’Reilly Mediaの Chapter 5.(Collaborating with Git - Part Ⅰ: Remote Work)、EXERCISE(382/715)の解答を求めてみる。

入出力結果(Terminal, Zsh)

% git status
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean
% git branch
* master
% ls
README.md	master-01.md
% code master-01.md 
% code master-02.md 
% git add master-01.md master-02.md
% git status
On branch master
Your branch is up to date with 'origin/master'.

Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
	modified:   master-01.md
	new file:   master-02.md

% git commit -m 'my first commit on master'
[master 177e981] my first commit on master
 2 files changed, 3 insertions(+)
 create mode 100644 master-02.md
%