I am using multiple git accounts from the same computer. I want to change settings for the accounts. Searched google, but wasn't able to find the command that helps to open the config file.
EDIT: It looks like there are different ways and config files to access github.
The answer given by @Altius and here: gist.github.com/jexchan/2351996
I tried both - after setting up SSH keys for my second account, but both failed to push repository to my second account, but I can see repositories being pushed to my first - default account irrespective of what changes I make to any of the config files.
.git
folder -> cd .git
config
file as vi config
[user] name = YOUR_USER_NAME email = YOUR_EMAIL
In your each repository, you can have different git@User
and associated git@email
* **Another way to set username and email to specific git repo
To set your username for a specific repository , enter the following command in the root folder of your repository : -
git config user.name "User_Name" git config user.email "your_email@example.com"
To set usernme as globally
Open your console and run the following - git config --list
It will give you present git configuration status.
You can set username
as global
git config --global user.name "User_Name" git config --global user.email "your_email@example.com"
Hope this would help your query
Answer is
git config --global -e
it will open .gitconfig
file in your default editor that you should have configured for git.
Table 4. Exhaustive list of core.editor configuration commands
Here is a simple step that I used to edit my git/config file
Ctrl+Alt+T
to open a terminal.git config --global --edit
It will open your global configuration file of git in your default editor. For more info on git config, you can check the entire manual by typing git config --help
in your terminal.
For mac users - You can just run this command
open ~/.gitconfig
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.