Git 基礎
初始化
git config --global user.name{name}
git config --global user.email{email}
- 免密碼設置
- 在用戶目錄下創建.git-credentials文件,並輸入以下內容
http://{username}:{password}@10.35.52.34
- 運行以下命令
-- .
- http最大緩存設置
-- .
- 大小寫敏感設置
git config --global core.ignorecase false
Git 工作流
- feature->examination->release
- hotfix
Tips
git status -s
git branch -vv
git branch {branchname}
git push -u origin HEAD
git fetch -p
git branch -vv | grep ':gone]' |sed 's/^\s\s//' | sed 's/\s.*$//g' | grep -v master | xargs -n 1 git branch -d
- 配置diff及merge工具
- diff
git config --global diff.tool {toolname}
git config --global difftool.{toolname}.path "{path}"
- merge
git config --global merge.tool {toolname}
git config --global mergetool.{toolname}.path "{path}"