简体   繁体   中英

How can I edit my .git/config file?

How can I edit my .git/config file?

Apparently, my heroku remote is set to something other than heroku ; as a result, I am unable to properly deploy my Rails app on Heroku. However, I can't find how to edit it to set it to the right thing.

Where can I find the config file? I can't find a file named that way in my repository or in my Git folder installation. Where should I search 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 the previous afformentioned error in my .git/config file

I am on Windows8

How can I edit my .git/config file?

Don't, unless you know exactly what you're doing. To modify your Git config, you should instead strive to use Git commands only. One reason for avoiding to edit the config file manually is that you may end up corrupting it inadvertently.

Apparently, my heroku remote is set to something other than heroku [...]

If I understand your problem correctly, you want to change the URL associated with the remote called heroku . First, check what the URL currently used is, by running

git remote -v

This command should list the fetch and push URLs associated with the remote heroku . If you find that those URLs are indeed incorrect, then run

git remote set-url heroku <new-url>

to set the URL of your heroku remote to <new-url> .

Your remotes are usually set in your local config file.
The file can be found end edited here: .git/config .
You can edit that directly or use the git config config to set/get entries in it.

git help config for details.

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