In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-11 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)05/31 Report--
This article introduces the relevant knowledge of "how to use git config for related configuration operations in gitlab". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Command: git config
Use git config for related configuration operations
Configuration file
Git as a whole, the configuration file is divided into three levels, combined with priority related information as follows
To put it simply, the closer the priority is to the warehouse, the higher it is, so project level > user level > system level. When the same settings appear at the same time, the higher priority will overwrite the upper configuration.
Configuration check
Using different parameters of git config, you can check the settings for the above three different levels.
Because the same setting may be overridden, using git config-l lists what git believes to be the final setting information
Problem phenomenon
Many clients encounter problems when automatically generating .gitignore, such as an error prompt for ng new action under the following versions of git and os
Environmental information
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$ |
Phenomenon
Liumiaocn:angualr liumiao$ ng new demo1-skip-install create demo1/readme.md (1021 bytes) create demo1/.angular-cli.json (1240 bytes)... Omit create demo1/src/app/app.component.ts (207bytes) 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$
Configuration information
Liumiaocn:angualr liumiao$ cat / usr/local/git/etc/gitconfig [core] excludesfile = ~ /. Gitignore legacyheaders = false # > git 1.5 quotepath = false [user] # name = your@name [mergetool] keepbackup = true [push] default = simple # [matching | simple] [color] ui = 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-ml = 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% c (bold green) (% cr)% creset% c (bold blue)% creset'-- abbrev-commit-- date=relative llg = log-- color-- graph-- pretty=format:'%c (bold white)% h% d% c% n% s% n% roomb% C (bold blue)% an% 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 = >\\ 2Candle'| 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$
Reason
The reason seems to be that there is a problem with the deployment of ~, which is tentatively solved by expanding ~ to a global name in the configuration file, but as we can see above, it is actually reducing the system-level setting to the user-level approach.
Modification method
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$ "how to use git config in gitlab for related configuration operations" is introduced here, thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.