Last active
August 29, 2015 14:19
-
-
Save fran0x/8ee812c4553cc2fa6b19 to your computer and use it in GitHub Desktop.
Setup Git on Windows
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install Git from http://git-scm.com/ and then launch Git Bash | |
# Generate SSH key pair | |
ssh-keygen -t rsa -C <username>@gmail.com | |
#Turn on SSH agent | |
ssh-agent -s | |
eval $(ssh-agent -s) | |
# List SSH keys registered in the SSH agent | |
ssh-add -l | |
# Add generated SSH key to the SSH agent | |
ssh-add /c/users/<username>/.ssh/id_rsa | |
# Copy SSH public key into clipboard and then register it into Git system | |
clip < /c/users/<username>/.ssh/id_rsa.pub | |
# Test host connection | |
ssh -T git@<host> | |
# External examples: ssh -v [email protected] or ssh -v [email protected] | |
# Setup Git profile | |
git config --global user.name = "<first name> <last name>" | |
git config --global user.email = <username>@gmail.com | |
git config --global color.ui = true | |
# Update .bashrc to avoid starting ssh-agent and adding SSH keys everytime: | |
#! /bin/bash | |
eval `ssh-agent -s` | |
ssh-add ~/.ssh/id_rsa | |
# In case the Git repository has been cloned using HTTPS then to avoid entering the credentials everytime | |
git remote set-url origin git@<host>:<project>.git |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment