計算機科学のブログ

ほしい物リスト

Git - GitHub - Collaborating with Git - Ⅱ: Go, Team, Go! - branch, switch, merge, push, delete

Head First Git: A Learner’s Guide to Understanding Git from the Inside OutRaju Gandhi(著)、 O’Reilly Mediaの Chapter 6.(Collaborating with Git - Ⅱ: Go, Team, Go!)、EXERCISE(438/680)の解答を求めてみる。

入出力結果(Terminal, Zsh)

% cd addisons-clone 
addisons-clone % git status
On branch addison-first-faq
nothing to commit, working tree clean
addisons-clone % git branch
* addison-first-faq
  master
addisons-clone % git switch master 
Switched to branch 'master'
Your branch is up to date with 'origin/master'.
addisons-clone % git merge addison-first-faq 
Updating 32b1d92..b278f04
Fast-forward
 FAQ.md | 7 +++++++
 1 file changed, 7 insertions(+)
 create mode 100644 FAQ.md
addisons-clone % git push
Enumerating objects: 4, done.
Counting objects: 100% (4/4), done.
Delta compression using up to 8 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 529 bytes | 529.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0), pack-reused 0 (from 0)
To https://github.com/kamimura/hawtdawg-all-ears.git
   32b1d92..b278f04  master -> master
addisons-clone % git status
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean
addisons-clone % git branch -     
--abbrev                     -- use specified digits to display object names  
--color                      -- turn on branch coloring                       
--column                     -- display tag listing in columns                
--contains                   -- only list branches that contain the specified 
--copy              -c       -- copy a branch and the corresponding reflog    
--create-reflog              -- create the branch's reflog                    
--delete            -d       -- delete a fully merged branch                  
--edit-description           -- edit branch description                       
--force             -f       -- force the creation of a new branch            
--ignore-case       -i       -- sorting and filtering are case-insensitive    
--list              -l       -- list only branches matching glob              
--merged                     -- only list branches that are fully contained by
--move              -m       -- rename a branch and the corresponding reflog  
--no-abbrev                  -- don't abbreviate sha1s                        
--no-color                   -- turn off branch coloring                      
--no-column                  -- don't display in columns                      
--no-contains                -- only list branches that don't contain the spec
--no-merged                  -- don't list branches that are fully contained b
--no-track                   -- override the branch.autosetupmerge configurati
--points-at                  -- only list tags of the given object            
--quiet             -q       -- be more quiet                                 
--remotes           -r       -- list or delete only remote-tracking branches  
--set-upstream-to   -u       -- set up configuration so that pull merges      
--show-current               -- show current branch name                      
--sort                       -- specify field to sort on                      
--track             -t       -- setup configuration so that pull merges from t
--unset-upstream             -- remove upstream configuration                 
--verbose           -vv  -v  -- show SHA1 and commit subject line for each hea
-C                           -- copy a branch even if the new branch-name alre
-D                           -- delete a branch                               
-M                           -- rename a branch even if the new branch-name al
-a                           -- list both remote-tracking branches and local b
addisons-clone % git branch      
  addison-first-faq
* master
addisons-clone % git branch -d addison-first-faq 
Deleted branch addison-first-faq (was b278f04).
addisons-clone % git branch
* master
addisons-clone % git log --oneline --all --graph 
* b278f04 (HEAD -> master, origin/master, origin/HEAD) addison's first commit
* 32b1d92 add README
addisons-clone %