Setting up Github with Git Bash
1)
Create
an account on Github
2)
Install
Gitbash from following URL:
3)
Set
up Github repositories:
Go to start -> all programs ->
git -> Open ‘Git bash’
On Command prompt:
Step
1:
git config --global user.name
"YOUR NAME"
Step 2:
git config --global user.email "YOUR EMAIL ADDRESS"
Step 3: Generate
new SSH Keys as follows:
Enter following command:
ssh-keygen -t rsa -b 4096 -C
"email@example.com"
Press Enter
Message
displayed: Created
directory '/p/.ssh'.
Step 4: Create a passphrase:
Enter
your passphrase. ( it can be different than your password)
Note: While setting pass
phrase, the cursor doesn’t move. Keep entering
your pass phrase.
To change pass phrase:
ssh-keygen -p
# Start the SSH key
creation process
Enter file in which
the key is (/Users/you/.ssh/id_rsa): [Hit enter]
Key has comment
'/Users/you/.ssh/id_rsa'
Enter new passphrase
(empty for no passphrase): [Type newpassphrase]
Enter same
passphrase again: [One more time for luck]
Your identification
has been saved with the new passphrase.:
If
success, message displayed:
Your identification has been saved with
the new passphrase.
Step 5: Adding your SSH key to the ssh-agent
1)
Ensure ssh-agent is enabled:
eval "$(ssh-agent -s)"
if success, message displayed:
agent
pid 8436
2)
Add SSH key to the ssh-agent.
ssh-add ~/.ssh/id_rsa
Enter pass phrase.
If
success, message displayed:
Identity added
Step 6: Add
SSH Key to Github account:
1) Copy
the SSH key to your clipboard.
clip < ~/.ssh/id_rsa.pub
Tip: If clip isn't
working, you can locate the hidden .ssh folder,
open the file in your favorite text editor, and copy it to your clipboard.
2)
Login to Github -> Top right -> Settingsà
SSH Keys à New SSH Key à Add Title and paste the key
You should receive an email.
4)
Get your code on local machine
Go to Git bash
1) Go
to your working location
Cd “<Your Location>”
2)
Run
following command:
git clone git@github.com:<<repo details>>
Comments