0

I have repository created and the following config file:

[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
[remote "origin"]
    url = https://user@github.com/repo/repo.git
    fetch = +refs/heads/*:refs/remotes/origin/*
[branch "develop"]
    remote = origin
    merge = refs/heads/develop

Now when I use git pull I get notification to input password for user but I don't know this user password. However I know password for different user and this user has access to this repository. Is it possible to run git pull to enter different user than in config file not modifying this config file?

Marcin Nabiałek
  • 98,126
  • 37
  • 219
  • 261

1 Answers1

0

You need to define your user as well

git config [--global] user.name "Your Name"
git config [--global] user.email "your@email.com"

Then GitHub will ask for the credentials for that user.

Also, it's considered better (and simpler, and safer) to generate SSH keys and define them on the remote repo.

Madara's Ghost
  • 158,961
  • 49
  • 244
  • 292
  • Thank you for reply. I've done it (without `--global`). Now I have in `config` file also section `user` with my Github user name and email assigned to this account. But when I simply run `git pull` I still get prompt `Password for user@github.com/repo/repo.git` and not for my user. – Marcin Nabiałek Jul 13 '15 at 14:54