How can I change the .git / config file?
How do I edit a file .git/config
?
Apparently my remote is heroku
set to a value other than heroku
; as a result, I cannot properly host the Rails application in Heroku. However, I cannot find how to edit it to install it correctly.
Where can I find the config file? I cannot find a file with that name in my repository or in my installation of the Git folder. Where should I look for it and can I edit it?
$ git remote -v
heroku https://git.heroku.com/pure-plateau-4958.git (fetch)
heroku https://git.heroku.com/pure-plateau-4958.git (push)
origin git@github.com:vike27/sciencevest100.git (fetch)
origin git@github.com:vike27/sciencevest100.git (push)
however heroku open doesn't work and heroku support says it is because of a previous error described in my .git / config file
I am on Windows8
How can I change the file
.git/config
?
Don't do it unless you know exactly what you are doing. To change your Git configuration, you should only use Git commands. One of the reasons for not manually editing the config file is that you might end up corrupting it unintentionally.
Apparently my remote is
heroku
set to something other thanheroku
[...]
If I understand your problem correctly, you want to change the url associated with the remote name heroku
. First, check what url is currently in use by running
git remote -v
This command should display URLs fetch
and push
related to the remote heroku
. If you find that these urls are indeed incorrect, run
git remote set-url heroku <new-url>
to set your remote's URL heroku
to <new-url>
.
Your remotes are usually installed in a local configuration file.
You can find the file here, edited here: .git/config
.
You can edit this directly or use the config git config
to set / get entries in it.
git help config
for details.