国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 服務器 > Web服務器 > 正文

gitlab實踐教程使用git config進行相關的配置操作

2024-09-01 13:56:18
字體:
來源:轉載
供稿:網友

這篇文章根據實際碰到的一個問題來介紹一下git配置相關的內容。

命令: git config

使用git config進行相關的配置操作

配置文件

git在整體上,配置文件分為三級,結合優先級相關信息如下

gitlab,git,config

簡單來說,優先級別離倉庫越近越高,所以 項目級別 > 用戶級別 > 系統級別。相同的設定同時出現時,優先級別高的會覆蓋上層的配置。

配置檢查

使用git config 不同的參數可以對如上三個不同的級別進行相關設定的檢查

gitlab,git,config

因為相同的設定有可能會產生覆蓋,使用git config -l會列出git認為的最終設定信息

問題現象

很多客戶端在自動生成.gitignore時會碰到問題,比如在如下git和os的版本下碰到了ng new動作發生的錯誤提示

環境信息

liumiaocn:angualr liumiao$ git --versiongit version 2.15.0liumiaocn:angualr liumiao$ uname -aDarwin liumiaocn 17.3.0 Darwin Kernel Version 17.3.0: Thu Nov 9 18:09:22 PST 2017; root:xnu-4570.31.3~1/RELEASE_X86_64 x86_64liumiaocn:angualr liumiao$ liumiaocn:angualr liumiao$ ng --version  _           _         ____ _   ___  / /  _ __  __ _ _  _| | __ _ _ __   / ___| |  |_ _| / △ / | '_ / / _` | | | | |/ _` | '__|  | |  | |  | | / ___ /| | | | (_| | |_| | | (_| | |   | |___| |___ | |/_/  /_/_| |_|/__, |/__,_|_|/__,_|_|    /____|_____|___|        |___/Angular CLI: 1.7.3Node: 8.9.1OS: darwin x64Angular: ...liumiaocn:angualr liumiao$

現象

liumiaocn:angualr liumiao$ ng new demo1 --skip-install create demo1/README.md (1021 bytes) create demo1/.angular-cli.json (1240 bytes)...省略 create demo1/src/app/app.component.ts (207 bytes)error: could not expand include path '~/.gitcinclude'fatal: bad config line 44 in file /usr/local/git/etc/gitconfigProject 'demo1' successfully created.liumiaocn:angualr liumiao$ 

配置信息

liumiaocn:angualr liumiao$ cat /usr/local/git/etc/gitconfig [core]  excludesfile = ~/.gitignore  legacyheaders = false # >git 1.5  quotepath = false[user]#  name = your name#  email = your@name[mergetool]  keepBackup = true[push]  default = simple # [ matching | simple ][color]  ui = auto  interactive = auto[repack]  usedeltabaseoffset = true # >git 1.5[alias]  s = status  a = !git add . && git status  au = !git add -u . && git status  aa = !git add . && git add -u . && git status  c = commit  cm = commit -m  ca = commit --amend # careful  ac = !git add . && git commit  acm = !git add . && git commit -m  l = log --graph --all --pretty=format:'%C(yellow)%h%C(cyan)%d%Creset %s %C(white)- %an, %ar%Creset'  ll = log --stat --abbrev-commit  lg = log --color --graph --pretty=format:'%C(bold white)%h%Creset -%C(bold green)%d%Creset %s %C(bold green)(%cr)%Creset %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative  llg = log --color --graph --pretty=format:'%C(bold white)%H %d%Creset%n%s%n%+b%C(bold blue)%an <%ae>%Creset %C(bold green)%cr (%ci)' --abbrev-commit  d = diff  master = checkout master  spull = svn rebase  spush = svn dcommit  alias = !git config --list | grep 'alias//.' | sed 's/alias//.//([^=]*//)=//(.*//)///1///t => //2/' | sort[include]  # as of 1.7.10 https://github.com/git/git/commit/9b25a0b52e09400719366f0a33d0d0da98bbf7b0  path = ~/.gitcinclude  path = .githubconfig  path = .gitcredential#[github]#  user =#  token =[diff]  # git does copy/rename *detection*. if you want it to track copies/renames:  # http://stackoverflow.com/questions/1043388/record-file-copy-operation-with-git  # renames = copies[diff "exif"]  textconv = exif[credential]  helper = osxkeychainliumiaocn:angualr liumiao$

原因

原因似乎是因為~的展開出現了問題,將~在設定文件中展開為全局的名稱暫定解決了這個問題,但是結合上文可知,其實是將系統級的設定降到了用戶級的處理方式。

修改方法

liumiaocn:angualr liumiao$ sudo cp /usr/local/git/etc/gitconfig /usr/local/git/etc/gitconfig.orgPassword:liumiaocn:angualr liumiao$ echo $HOME/Users/liumiaoliumiaocn:angualr liumiao$ echo ~/Users/liumiaoliumiaocn:angualr liumiao$ sudo vi /usr/local/git/etc/gitconfigliumiaocn:angualr liumiao$ liumiaocn:angualr liumiao$ diff /usr/local/git/etc/gitconfig /usr/local/git/etc/gitconfig.org2c2<  excludesfile = /Users/liumiao/.gitignore--->  excludesfile = ~/.gitignore44c44<  path = /Users/liumiao/.gitcinclude--->  path = ~/.gitcincludeliumiaocn:angualr liumiao$

總結

以上就是這篇文章的全部內容了,希望本文的內容對大家的學習或者工作具有一定的參考學習價值,謝謝大家對VEVB武林網的支持。


注:相關教程知識閱讀請移步到服務器教程頻道。
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 益阳市| 稷山县| 南通市| 德格县| 始兴县| 安康市| 英山县| 苏尼特左旗| 德州市| 嘉禾县| 韩城市| 江都市| 衡山县| 博客| 邻水| 辉县市| 乳山市| 通化县| 南陵县| 奎屯市| 虹口区| 五指山市| 宜城市| 灵山县| 勃利县| 丰顺县| 烟台市| 平陆县| 江安县| 三河市| 绍兴市| 娱乐| 怀安县| 汉沽区| 西乡县| 和龙市| 阿拉善左旗| 高密市| 台安县| 淮北市| 滦平县|