How to push as different user in github

99 views 11:55 pm 0 Comments March 18, 2019
  • Remove all existing keys
  • Generate ssh key for the current user which wants to commit to github
  • add the ssh key for new user
  • Initialise the new Repository¬†
  • Add the remote url ( here note that we are not using https url)
  • Add user name and email to git config
  • Commit and push to git
[shell] //check and delete existing keys ssh-add -l ssh-add -d //add new key ssh-add new_ssh_rsa_key git init git remote add origin git@github.com:git.user.name/ansible-utilities.git git config –list git config user.name "User name" git config user.email "User email" //Now push git add . git commit -m "Initial commit" git push -u origin master [/shell]

Leave a Reply

Your email address will not be published. Required fields are marked *