Git: Clone / Pull without password

Posted: February 20, 2014 in Git
Tags:

Hi, my repositories are in Bitbucket,  and i’m using ssh to git clone / git pull without asking the password.

My environment is Ubuntu.

Here are my steps:

  1. $ su – your_username
  2. $ ssh-keygen
    (then Enter Enter Enter)
    $ ps -e | grep [s]sh-agent
    $ ssh-agent /bin/bash
    $ ssh-add ~/.ssh/id_rsa
    $ ssh-add -l
    $ cat ~/.ssh/id_rsa.pub (copy key and paste to repo Bitbucket – Settings – Deployment Keys)
  3. In Bitbucket, click Clone, then from the dropdown choose SSH, copy clone the url
  4. Then $ cd /your/project_folder
  5. Then paste the clone url
    1. eg: git clone git@bitbucket.org:flakesns/yiiproject.git .
    2. Notice the . (dot) will extract the file in the project folder – will not create new folder ‘yiiproject’.
  6. Ok DONE.

So next time git won’t ask password when you git pull any update from your project repositories.

Bye…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s