Git Pull: Change Authentication

Hey all, this is quick one, since I’m quite new to git. I have a repo setup on a server (A) where access is via ssh rsa keys. I have a few users there including myself. Now I do git clone on my local machine and get a local copy, make changes, and push origin master, everything works fine.

The problem I’m experiencing is that our testing server (server B) already has everything setup and what I’d like to do is pull my latest changes to that server. The testing server has also got several users, as well as www-data as the owner of the whole directory (running Apache).

  • “Writeable by group” exception for php scripts which are under git control
  • Configure .htaccess file for multiple environments
  • svn: Repository moved temporarily to 'main'; please relocate
  • Execute git commit from php file in current directory
  • Generating SSH keys for 'apache' user
  • git-http-backend with AuthzUnixGroup not working properly
  • When logging in via SSH using my name, I cannot git pull, says .git is locked, so I do sudo git pull which asks me the password for a different user (user1). I do not know that password and I’d like to remove that user completely, but before I do, I have to switch the git repo on the testing server to pull changes using MY authentication (kovshenin) and not user1’s.

    What’s the correct way to do that? I wouldn’t like to remove everything and start from a fresh clone, since it has some local changes.

    Thanks in advance for all your help.

  • Whats the best way to clone / duplicate a project into a new with git?
  • Are “git add file” and “git checkout — file” symmetric?
  • GIT PUSH - Is there any way to know which developer actually pushed a code?
  • How do I connect github to JIRA?
  • How do I ignore this Eclipse file in Git?
  • Git LFS Error: OID Confused
  • One Solution collect form web for “Git Pull: Change Authentication”

    After three hours of searching and playing I have found the answer myself. The authentication details are stored in the .git/config file under the url setting in the [remote "origin"] section. Thanks.

    Git Baby is a git and github fan, let's start git clone.