Skip to content

Instantly share code, notes, and snippets.

@pratos
Last active September 12, 2017 07:14
Show Gist options
  • Save pratos/2b9bd5148158d35c38cd9d2ccdc7ef99 to your computer and use it in GitHub Desktop.
Save pratos/2b9bd5148158d35c38cd9d2ccdc7ef99 to your computer and use it in GitHub Desktop.
Controlling the contributions from separate workstation
  • Generate ssh keys:
    • ssh-keygen -t rsa -C "<emai-id>@gmail.com"
  • Add them, delete the previous ones:
    • ssh-add ~/.ssh/id_rsa_prato_git
    • ssh-add -D
    • ssh-add -l
  • Change the config file:
    • vim config
    • Add below:
      #git account
        Host github.com-pratos
          HostName github.com
          User git
          IdentityFile ~/.ssh/id_rsa_prato_git
      
  • Clone the repository:
  • cd into the repository:
    • cd <repo-name>
  • Add the details:
    • git config user.name "pratos"
    • git config user.email "<email-id>@gmail.com"
  • To check whether your contribution is reflecting, do a git push:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment