title: How to change git user in Visual Studio Code or even in command line? (Permission denied to user1, The requested URL returned error: 403)
body: <p>I am in VS code as a particular git user (say user1) and want to pull &amp; commit changes from one of my other github accounts (user2). After pulling my repository &amp; commiting when I push I get the error of type: </p>
  
  <pre><code>remote: Permission to user2/repository.git denied to user1.
  fatal: unable to access 'https://github.com/user2/repository.git/': The requested URL returned error: 403
  </code></pre>
  
  <p>So I assume this error is simply because I am 'logged in' as user1 in VS code. But how exactly can I change myself to user2 to be able to work on this repository? </p>
  
  <p>I am using Macbook. I have tried many variety of ways e.g. changing to SSH cloning &amp; resetting git config without any luck. There has to be a very simple solution to this problem which should be very basic. I was expecting it will ask me for credentials for the second account but it never did.</p>