git set username and password

git set username and password

Set git

username / mailbox This operation requires you to enter the username/password for verification, and you still need to set it every time, so what should I do? Git saves username and password here is mainly to configure a config item. There are two methods. Basically, the principle is the same. Both modify the .git/config file . 1. Use the following command to modify the config file to save echo "[credential]" >> .git/config echo "helper = store" >> .git/config 1 2 2. Modify the .git/config file directly Under linux/mac, you can directly use the vim tool to modify the config file ubuntu@VM-7-212- ubuntu:~/kernel-code/kernel-netfilter-sample-code$ vim .git/config ##Modify to the following [core]     repositoryformatversion = 0     filemode = true




























    bare = false
    logallrefupdates = true
[remote "origin"]
    url = https://github.com/Miss-you/kernel-netfilter-sample-code.git
    fetch = +refs/heads/*:refs/remotes/origin/ *
[branch "master"]
    remote = origin
    merge = refs/heads/master
##Mainly the last two lines, if you don't want to save, just delete it
[credential]
    helper = store

##Save

this way you can save the username and password , no need to enter it every time!

git config to view the configuration

Use git config --list to view the set configuration

feiqianyousadeMacBook-Pro:xt_GTPU yousa$ git config --list
core.excludesfile=/Users/yousa/.gitignore_global
user.name=Miss-you
user.email=snowfly1993@ gmail.com
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
core.ignorecase=true
core.precomposeunicode=true
remote.origin.url=https://github.com/Miss-you/xt_GTPU.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master

http://blog.csdn.net/qq_15437667/article/details/51029757

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326520377&siteId=291194637