xgqfrms™, xgqfrms® : xgqfrms's offical website of cnblogs! xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

git config All In One

git config All In One

git config

git global config

# git global config
$ git config

$ git config --list --show-origin

$ git config --global user.name "xgqfrms"
$ git config --global user.email "xgqfrms@xgqfrms.xyz"

# $ git config --global core.editor emacs
$ git config --global core.editor vscode

$ git config --global core.editor "'C:/Program Files/Notepad++/notepad++.exe' -multiInst -notabbar -nosession -noPlugin"

vscode

$ code ~/.gitconfig

$ code .git/config

[filter "lfs"]
	clean = git-lfs clean -- %f
	smudge = git-lfs smudge -- %f
	process = git-lfs filter-process
	required = true
[user]
	name = xgqfrms
	email = xgqfrms@xgqfrms.xyz
[core]
	excludesfile = /Users/xgqfrms-mbp/.gitignore_global
[difftool "sourcetree"]
	cmd = opendiff \"$LOCAL\" \"$REMOTE\"
	path = 
[mergetool "sourcetree"]
	cmd = /Applications/Sourcetree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\"
	trustExitCode = true
[commit]
	template = /Users/xgqfrms-mbp/.stCommitMsg



$ git config --global user.name "xgqfrms"
$ git config --global user.email "xgqfrms@xgqfrms.xyz"


$ git config user.name "xgqfrms"
$ git config user.email "xgqfrms@xgqfrms.xyz"

git local config

.git/config

# local config
$ git config --local -l
# edit
$ git config --local -e

$ cd .git
$ code .

$ git config user.name "your-user-name"
$ git config user.email "your-email-addr"

$ git config user.name "webgeeker"
$ git config user.email "webgeeker@webgeeker.xyz"

git

https://www.atlassian.com/git/tutorials/setting-up-a-repository/git-config

https://git-scm.com/docs/git-config

github

https://help.github.com/en/articles/setting-your-username-in-git

https://help.github.com/en/articles/set-up-git

git config & color.ui

$ git config --global user.name "xgqfrms"

$  git config --global user.email xgqfrms@xgqfrms.xyz
# color.ui
$ git config --global color.ui true

image

git config

# global config
$ code ~/.gitconfig

# local project config
$ code .git/config

https://gist.github.com/xgqfrms/50c276b2f45631660f3c62705dacca46

$ git config

usage: git config [<options>]

Config file location
    --global              use global config file
    --system              use system config file
    --local               use repository config file
    --worktree            use per-worktree config file
    -f, --file <file>     use given config file
    --blob <blob-id>      read config from given blob object

Action
    --get                 get value: name [value-regex]
    --get-all             get all values: key [value-regex]
    --get-regexp          get values for regexp: name-regex [value-regex]
    --get-urlmatch        get value specific for the URL: section[.var] URL
    --replace-all         replace all matching variables: name value [value_regex]
    --add                 add a new variable: name value
    --unset               remove a variable: name [value-regex]
    --unset-all           remove all matches: name [value-regex]
    --rename-section      rename section: old-name new-name
    --remove-section      remove a section: name
    -l, --list            list all
    -e, --edit            open an editor
    --get-color           find the color configured: slot [default]
    --get-colorbool       find the color setting: slot [stdout-is-tty]

Type
    -t, --type <>         value is given this type
    --bool                value is "true" or "false"
    --int                 value is decimal number
    --bool-or-int         value is --bool or --int
    --path                value is a path (file or directory name)
    --expiry-date         value is an expiry date

Other
    -z, --null            terminate values with NUL byte
    --name-only           show variable names only
    --includes            respect include directives on lookup
    --show-origin         show origin of config (file, standard input, blob, command line)
    --default <value>     with --get, use default value when missing entry

https://github.com/xgqfrms/git/tree/master/git-config

https://www.shellhacks.com/git-config-username-password-store-credentials/

filename & lowercase

http://www.ruanyifeng.com/blog/2017/02/filename-should-be-lowercase.html

git cli & create remote branch

# Create a new branch and check it out
$ git checkout -b <branch-name>

# The remote branch is automatically created when you push it to the remote server. 
# <remote-name> is typically origin
$ git push <remote-name> <branch-name> 

$ git push <remote-name> <local-branch-name>:<remote-branch-name>

$ git push --set-upstream <remote-name> <local-branch-name> 

# create a new branch & check it out
$ git checkout -b test

# local & remote  with the same name
$ git push origin test

# local & remote with a different name
$ git push origin test:dev

# ❌ delete remote brach bug, if only `:<remote-branch-name>` 
$ git push origin :dev


https://tecadmin.net/how-to-create-a-branch-in-remote-git-repository/

https://stackoverflow.com/questions/1519006/how-do-you-create-a-remote-git-branch

git config demo

https://gist.github.com/xgqfrms/50c276b2f45631660f3c62705dacca46

refs



©xgqfrms 2012-2020

www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!

原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!


posted @ 2019-10-03 22:07  xgqfrms  阅读(245)  评论(3编辑  收藏  举报