tags:

views:

60

answers:

1

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

+3  A: 
git remote add github [email protected]:username/Project.git

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

[remote "github"]
        url = [email protected]:username/Project.git
        fetch = +refs/heads/*:refs/remotes/github/*
Alan Haggai Alavi
@Alan: It seems that this is the only place where Git saves the secret data.
Masi
@Masi: Git makes many entries in `.git/config` as part of some commands.
Alan Haggai Alavi
1.) "git remote add ..." doesn't add any 'secret token' 2.) repository configuration file (.git/config) is the only sane place to add remotes configuration, which are repository-specific
Jakub Narębski