Git 進階使用
使用 rev-parse
# Getting the top-level directory
git rev-parse --show-toplevel
# Find your way home
git rev-parse --show-cdup
## Current location
# 判斷是否在專案目錄 <git-repo>/.git 底下
git rev-parse --is-inside-git-dir
# 判斷是否在專案目錄 <git-repo> 底下 (不包含 .git 目錄下)
git rev-parse --is-inside-work-tree
合併發生衝突
Git credential cache
This command caches credentials for use by future Git programs. The stored credentials are kept in memory of the cache-daemon process (instead of being written to a file) and are forgotten after a configurable timeout.
git config credential.helper cache
git config credential.helper 'cache --timeout=3600'
No Comments