config
installation
[!NOTE|label:references:]
ubuntu
from source
[!NOTE|label:references:]
dependencies
[!NOTE|label:references:]
git-core
git-doc
git-info
others
install
[!NOTE|label:release package:]
result
pacakges:
[!TIP|label:check apt package bin path without install:]
bins :
/usr/local/bingit-core :
/usr/local/libexec/git-coreor$ git --exec-pathdiff-highlight :
/usr/share/doc/git/contrib/diff-highlight/diff-highlightgit-prompt.sh :
/usr/local/libexec/git-core/git-prompt.shgit-completion :
/usr/share/bash-completion/completions/gitgit-info :
/usr/local/share/info
location
[!NOTE|label:locations]
system
<GIT_DIR>\etc\gitconfig
<GIT_DIR>/etc/gitconfig
system example
%LOCALAPPDATA%\Programs\Git\etc\gitconfig
/usr/local/etc/gitconfig
global
%USERPROFILE%\.gitconfig
$HOME/.gitconfig
local
<git-repo>\.git\config
<git-repo>/.git/config
portable
%PROGRAMDATA%\Git\config
-
get locations
windows
osx
edit config file
list
list all with scope
list origin
list single scope only
list local only
list global
list system
get from all configure
colors
[!NOTE|label:references:]
attributes:
bold,dim,ul,blink,reverse,italic,strike,no-ul,no-reverse,no-dim, ..colors: ANSI 256-colors ( 0~255 ). specify 24-bit RGB values as hex, like #ff0ab3. color names, like red, green, ...
configure:
[!NOTE|label:references:]
color.branch.<slot>:current,local,remote,upstream,plain
color.diff.<slot>:context,meta,frag,old,new,plain,commit,whitespace,oldMoved,newMoved,oldMovedDimmed,newMovedDimmed,oldMovedAlternative,newMovedAlternative,oldMovedAlternativeDimmed,newMovedAlternativeDimmedcontextDimmed,oldDimmed,newDimmed,contextBold,oldBold,newBold
color.decorate.<slot>:branch,remoteBranch,tag,stash,HEAD
color.grep.<slot>context,filename,function,lineNumber,match,matchContext,matchSelected,selected,separator
color.interactive.<slot>:prompt,header,help,error
color.status.<slot>:added,updated,changed,untracked,branch,nobranch,localBranch,remoteBranch,unmerged
color.remote.<slot>:hint,warning,success,error
color.grep.<slot>:context,filename,function,lineNumber,column,match,matchContext,matchSelected,selected,separator
list
color.*config[!TIP|label:see also:]
gitconfig
help
autocorrect[!NOTE|label:references:]
credential
[!NOTE]
TOKEN TYPE
GIT OPERATIONS
(clone/push)
GIT LFS UPLOAD/DOWNLOAD
GITHUB ACTIONS (WORKFLOW)
semantic-release
GITHUB API (REST/GRAPHQL)
PRIVATE SUBMODULES
GITHUB CLI (GH)
NOTES
Fine-grained PAT
β
β Fails (LFS lock verification denied)
β
β
β
β
β οΈ Partially supported
Secure and scoped, but limited in CLI/automation contexts like Git LFS
Classic PAT
β
β
β
β
β
β
β
Recommended for CLI tools, LFS, CI/CD, automation, and broad API access
using specific PAT
include.pathGIT_CREDENTIAL_HELPERGIT_ASKPASSandcore.askPass
.git-credentials file keeping revert back
[!TIP|label:reason:]
in macOS, the
osxkeychainhelper is used by default, which stores credentials in the macOS Keychain. even if the.git-credentialsfile is manual updated, theosxkeychainhelper will overwrite it with the credentials stored in the Keychain.solutions:
completely disable the
osxkeychainhelper in global configupdate the password in keychain
git lfs
[!NOTE|label:references:]
git-lfs not support Fine-grained Token (FGPAT) credential, reason:
git lfs is NOT push into the git repo, but push the LFS objects to the sepcific endpoint:
the git-lfs will try to execute:
/locks/verify: require write access
/info/lfs/objects/batch(deploy LFS object) : require read/write accesshave to use the token in
Authorization: Basicheaderbut the Fine-grained Token (FGPAT) only support
git pushandgit pulloperations, not support the private API:
/info/lfs/objects/batch
/locks/verify
why Classic Token (PAT) works, since it will not restrict the access to endpoint:
reposcope: read/write access to code
write:packagesscope: write access to packages
read:packagesscope: read access to packages
references:
tips
environment failed to $ ssh -vT git@github.com -p 22
$ ssh -vT git@github.com -p 22using https instead of ssh first
setup credential
create the credential file
to read the credentials file
with GIT_USERNAME and GIT_ASKPASS
GIT_USERNAME and GIT_ASKPASS[!NOTE|label:references:]
env.GIT_ASKPASS
core.askPass
SSH_ASKPASSGIT_ASKPASS with user and password | JENKINS-56897 - Support general purpose authenticated git operations in Pipeline](https://issues.jenkins.io/browse/JENKINS-56897#comment-364399)
[!TIP]
the
git-lfsNOT supportcore.askPass. it usecredential.helperonly
via config
via environment
[!TIP]
GIT_ASKPASSmust be a executable script
http.cookiefile
[!NOTE|label:references:]
[!TIP|label:check expiration]
1
.googlesource.com
Domain: target domain the cookie applies to (including subdomains)
2
TRUE
Include Subdomains: if TRUE, the cookie is sent to subdomains
3
/
Path: url path prefix the cookie is valid for
4
TRUE
Secure Only: if TRUE, cookie is only sent over HTTPS
5
2147483647
Expiration (Unix time): when the cookie expires (here: 2038-01-19)
6
o
Cookie Name: gerrit expects the cookie to be named o
7
git-account.gmail.com=...
Cookie Value: key-value pair used for authentication (username=token)
cookie value explaination
Username / Identifier
git-account.gmail.com
identity used by Gerrit
Authentication Token
1//0ABC...XYZ
oAuth-style or Gerrit token
Separator
=
separates identity from token
generate cookies
[!TIP|label:references:]
open https://www.googlesource.com/new-password URL to generate new token/password if HTTP Credentials ->
Obtain passwordis not working
verify
[!NOTE|label:googlesource repos]
commit.template
commit.templateusage
default configuration
core.editoruse vim ( the ubiqutos text editor ) as Git's default editor

core.editor init.defaultBranchoverride the default branch name for new repositories

core.editor core.autocrlf[!TIP|label:see also:]
checkout windows-style, commit unix-style line endings
checkout as-is, commit unix-style line endings
checkout as-is, commit as-is

core.editor pull.rebase
core.editor core.fscache&core.symlinksenable file system caching
enable symbolic links

core.editor core.fsmonitorenable experimental built-in file system monitor

core.editor
__git_ps1
__git_ps1[!NOTE|label:localtion]
osx:
$(brew --prefix git)/etc/bash_completion.d/git-prompt.sh
add to bash_completion.d
tig
[!NOTE|label:references:]
result
troubleshooting
[!TIP]
ld: archive member '/' not a mach-o file
ld: archive member '/' not a mach-o file[!NOTE]
xCode
Last updated
Was this helpful?
