計算機科学のブログ

ほしい物リスト

Git - Making your life Easier with Git: Pro Tips - gitignore file, operating system, macOS

Head First Git: A Learner’s Guide to Understanding Git from the Inside OutRaju Gandhi(著)、 O’Reilly Mediaの Chapter 8.(Making your life Easier with Git: #Pro Tips)、SHARPEN YOUR PENCIL(621/680)の解答を求めてみる。

入出力結果(Terminal, Zsh)

% touch .gitignore
% code .          
% git init
hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint:
hint: 	git config --global init.defaultBranch <name>
hint:
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint:
hint: 	git branch -m <name>
Initialized empty Git repository in /Users/.../a-head-above/chapter-08/.git/
% git add .gitignore 
% git commit -m 'gitignore for macOS'
[master (root-commit) d66a77f] gitignore for macOS
 1 file changed, 28 insertions(+)
 create mode 100644 .gitignore
% git loga 
* d66a77f (HEAD -> master) gitignore for macOS
% cat .gitignore 
# https://github.com/github/gitignore/blob/main/Global/macOS.gitignore
# Global
# macOS
# General
.DS_Store
.AppleDouble
.LSOverride
Icon[]

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

%