简体   繁体   中英

How does Git decide where to save secret tokens exactly?

This question is based on this thread .

I am interested in how Git decides where to save secret tokens exactly when you run

git remote add github...

In other words, I would like to know which file affects this behavior. I know that it can be changed, since that info was stored to my old .gitconfig, while it is now at .git/.

This may be a recent change in Git.

Which file does make Git to save secret tokens to /.git/?

git remote add github git@github.com:username/Project.git

The above command creates an entry in .git/config file. For example:

[remote "github"]
        url = git@github.com:username/Project.git
        fetch = +refs/heads/*:refs/remotes/github/*

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM