Git如何决定在哪里保存秘密令牌? [英] How does Git decide where to save secret tokens exactly?

查看:140
本文介绍了Git如何决定在哪里保存秘密令牌?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此问题基于此主题

我对Git如何确定在运行时准确保存秘密令牌的方式很感兴趣

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

git remote add github...

换句话说,我想知道哪个文件影响这种行为。我知道它可以改变,因为这些信息被存储到我的老的.gitconfig,而它现在在.git /.

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/.

这可能是最近的一次改变Git。

This may be a recent change in Git.

哪个文件可以让Git保存秘密标记为/.git /?

推荐答案

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

以上命令在 .git / config 文件中创建一个条目。例如:

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/*

这篇关于Git如何决定在哪里保存秘密令牌?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆