計算機科学のブログ

ほしい物リスト

Git - GitHub - Collaborating with Git - Part Ⅰ: Remote Work - warming up

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(362/680)の解答を求めてみる。

入出力結果(Terminal, Zsh)

% cd working-with-remotes 
working-with-remotes % git branch 
* master
working-with-remotes % git status
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean
working-with-remotes % code .
working-with-remotes % git add master-01.md master-02.md
working-with-remotes % 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

working-with-remotes % git commit -m 'my first commit on master'
[master 873304c] my first commit on master
 2 files changed, 3 insertions(+)
 create mode 100644 master-02.md
working-with-remotes % git status
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
  (use "git push" to publish your local commits)

nothing to commit, working tree clean
working-with-remotes % git log --oneline --all --graph
* 873304c (HEAD -> master) my first commit on master
* 5aefc0d (origin/master, origin/HEAD) add master-01 file
* f9fd4aa add README
working-with-remotes %