{"id":2017,"date":"2013-09-18T18:02:42","date_gmt":"2013-09-18T18:02:42","guid":{"rendered":"https:\/\/www.anagram.at\/en\/get-gitbash-and-tortoisegit-up-and-running\/"},"modified":"2013-09-18T18:02:42","modified_gmt":"2013-09-18T18:02:42","slug":"get-gitbash-and-tortoisegit-up-and-running","status":"publish","type":"post","link":"https:\/\/www.anagram.at\/en\/get-gitbash-and-tortoisegit-up-and-running\/","title":{"rendered":"#gitbash, #tortoisegit"},"content":{"rendered":"<div id=\"main-header\">\n<div id=\"title-heading\">\n<h1 id=\"title-text\"><a href=\"https:\/\/confluence.atlassian.com\/display\/BITBUCKET\/Set+up+SSH+for+Git\">Set up SSH for Git<\/a><\/h1>\n<\/div>\n<\/div>\n<div id=\"content\">\n<div id=\"action-messages\"><\/div>\n<div>\n<p>Up until this point, you have been using the secure hypertext transfer protocol (HTTPS) to communicate between your local system and Bitbucket. When you use HTTPS, you need to authenticate (supply a username and password) each time you take an action that communicates with the Bitbucket server. You can specify the username in the DVCS configuration file; you don&#8217;t want to store your password there though where anyone can see it. So, this means you must manually type a password when you use HTTPS with\u00a0 your local repository. Who wants to do that? This page shows you how to use secure shell (SSH) to communicate with the Bitbucket server and avoid having to manually type a password.<\/p>\n<p>Finally, setting up an SSH identity can be prone to error. Allow yourself some time, perhaps as much as an hour depending on your experience, to complete this page. If you run into issues, check out\u00a0<a href=\"https:\/\/confluence.atlassian.com\/display\/BITBUCKET\/Troubleshoot+SSH+Issues\">Troubleshoot SSH Issues<\/a>\u00a0for extra information that may help you along. You can even skip this whole page and continue to use HTTPS if you want.<\/p>\n<div>\n<div><b>Linux or Mac User?<\/b><\/div>\n<div>\n<p>This page shows you how to set up and use a\u00a0<em>single default SSH identity<\/em>\u00a0on Windows for a Git repository using GitBash. In the next page, you set up SSH for a Mercurial repository on Windows with TortoiseHg. If you are working on Mac OSX or Linux, a single set of instructions shows you\u00a0<a href=\"https:\/\/confluence.atlassian.com\/pages\/viewpage.action?pageId=270827678\">how to setup and identity for either Git or Mercurial<\/a>\u00a0in these environments.<\/p>\n<\/div>\n<\/div>\n<h2 id=\"SetupSSHforGit-Step1.ReadaquickoverviewofSSHconcepts\">Step 1. Read a quick overview of SSH concepts<\/h2>\n<p>To use SSH with Bitbucket, you create an SSH identity. An identity consists of a private and a public key which together are a key pair. The private key resides on your local computer and the public you upload to your Bitbucket account. Once you upload a public key to your account, you can use SSH to connect with repositories you own and repositories owned by others, provided those other owners give your account permissions. By setting up SSH between your local system and the Bitbucket server, your system uses the key pair to automate authentication; you won&#8217;t need to enter your password each time you interact with your Bitbucket repository.<\/p>\n<p>There are a few important concepts you need when working with SSH identities and Bitbucket<\/p>\n<ul>\n<li>You cannot reuse an identity&#8217;s public key across accounts. If you have multiple Bitbucket accounts, you must create multiple identities and upload their corresponding public keys to each individual account.<\/li>\n<li>You\u00a0<em>can<\/em>\u00a0associate multiple identities with a Bitbucket account. You would create multiple identities for the same account if, for example, you access a repository from a work computer and a home computer. You might create multiple identities if you wanted to execute DVCS actions on a repository with a script \u2013 the script would use a public key with an empty passphrase allowing it to run without human intervention.<\/li>\n<li>RSA (R.\u00a0<strong>R<\/strong>ivest, A.\u00a0<strong>S<\/strong>hamir, L.\u00a0<strong>A<\/strong>dleman are the originators) and digital signature algorithm (DSA) are key encryption algorithms. Bitbucket supports both types of algorithms. You should create identities using whichever encryption method is most comfortable and available to you.<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h2 id=\"SetupSSHforGit-Step2.CheckifyouhaveexistingdefaultIdentity\">Step 2. Check if you have existing default Identity<\/h2>\n<p>The Git Bash shell comes with an SSH client. Do the following to verify your installation:<\/p>\n<ol>\n<li>Double-click the Git Bash icon to start a terminal session.<\/li>\n<li>Enter the following command to verify the SSH client is available:\n<div>\n<div>\n<pre>manthony@MANTHONY-PC ~\r\n$ ssh -v\r\nOpenSSH_4.6p1, OpenSSL 0.9.8e 23 Feb 2007\r\nusage: ssh [-1246AaCfgkMNnqsTtVvXxY] [-b bind_address] [-c cipher_spec]\r\n[-D [bind_address:]port] [-e escape_char] [-F configfile]\r\n[-i identity_file] [-L [bind_address:]port:host:hostport]\r\n[-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port]\r\n[-R [bind_address:]port:host:hostport] [-S ctl_path]\r\n[-w local_tun[:remote_tun]] [user@]hostname [command]<\/pre>\n<\/div>\n<\/div>\n<\/li>\n<li>If you have\u00a0<code>ssh<\/code>\u00a0installed, go to the next step.<br \/>\nIf you don&#8217;t have\u00a0<code>ssh<\/code>\u00a0installed, install it now with your package manager.<\/li>\n<li>List the contents of your\u00a0<code>~\/.ssh<\/code>\u00a0directory.<br \/>\nIf you have not used SSH on Bash you might see something like this:<\/p>\n<div>\n<div>\n<pre>manthony@MANTHONY-PC ~\r\n$ ls -a ~\/.ssh\r\nls: \/c\/Users\/manthony\/.ssh: No such file or directory<\/pre>\n<\/div>\n<\/div>\n<p>If you have a default identity already, you&#8217;ll see two\u00a0<code>id_*<\/code>\u00a0files:<\/p>\n<div>\n<div>\n<pre>manthony@MANTHONY-PC ~\r\n$ ls -a ~\/.ssh\r\n.    ..    id_rsa    id_rsa.pub  known_hosts<\/pre>\n<\/div>\n<\/div>\n<p>In this case, the default identity used RSA encryption (<code>id_rsa.pub<\/code>). If you want to use an existing default identity for your Bitbucket account, skip the next section and go to\u00a0<a href=\"https:\/\/confluence.atlassian.com\/display\/BITBUCKET\/Set+up+SSH+for+Git#SetupSSHforGit-Step4.Createaconfigfile\" rel=\"nofollow\">create a config file<\/a>.<\/li>\n<\/ol>\n<h2 id=\"SetupSSHforGit-Step3.Setupyourdefaultidentity\">Step 3. Set up your default identity<\/h2>\n<p>By default, the system adds keys for all identities to the\u00a0<code>\/Users\/<em>yourname<\/em>\/.ssh<\/code>\u00a0directory. The following procedure creates a default identity.<\/p>\n<ol>\n<li>Open a terminal in your local system.<\/li>\n<li>Enter\u00a0<code>ssh-keygen<\/code>\u00a0at the command line.<br \/>\nThe command prompts you for a file to save the key in:<\/p>\n<div>\n<div>\n<pre>manthony@PHOENIX ~\r\n$ ssh-keygen\r\nGenerating public\/private rsa key pair.\r\nEnter file in which to save the key (\/c\/Documents and Settings\/manthony\/.ssh\/id_\r\nrsa):<\/pre>\n<\/div>\n<\/div>\n<\/li>\n<li>Press enter to accept the default key and path,\u00a0<code>\/c\/Documents and Settings\/manthony\/.ssh\/id_rsa<\/code>, or you can create a key with another name.<br \/>\nTo create a key with a name other than the default, specify the full path to the key. For example, to create a key called\u00a0<code>my-new-ssh-key<\/code>, you would enter a path like this at the prompt:<\/p>\n<div>\n<div>\n<pre>manthony@PHOENIX ~\r\n$ ssh-keygen\r\nGenerating public\/private rsa key pair.\r\nEnter file in which to save the key (\/c\/Documents and Settings\/manthony\/.ssh\/id_\r\nrsa): \/c\/Documents and Settings\/manthony\/My Documents\/keys\/my-new-ssh-key<\/pre>\n<\/div>\n<\/div>\n<\/li>\n<li>Enter and renter a passphrase when prompted.<br \/>\nUnless you need a key for a process such as script, you should always provide a passphrase.<br \/>\nThe command creates your default identity with its public and private keys. The whole interaction looks similar to the following:<\/p>\n<div>\n<div>\n<pre>manthony@MANTHONY-PC ~\r\n$ ssh-keygen\r\nGenerating public\/private rsa key pair.\r\nEnter file in which to save the key (\/c\/Users\/manthony\/.ssh\/id_rsa):\r\nCreated directory '\/c\/Users\/manthony\/.ssh'.\r\nEnter passphrase (empty for no passphrase):\r\nEnter same passphrase again:\r\nYour identification has been saved in \/c\/Users\/manthony\/.ssh\/id_rsa.\r\nYour public key has been saved in \/c\/Users\/manthony\/.ssh\/id_rsa.pub.\r\nThe key fingerprint is:\r\ne7:94:d1:a3:02:ee:38:6e:a4:5e:26:a3:a9:f4:95:d4 manthony@MANTHONY-PC\r\nmanthony@MANTHONY-PC ~\r\n$<\/pre>\n<\/div>\n<\/div>\n<\/li>\n<li>List the contents of\u00a0<code>~\/.ssh<\/code>\u00a0to view the key files.<br \/>\nYou should see something like the following:<\/p>\n<div>\n<div>\n<div id=\"highlighter_606990\">\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td>\n<div title=\"Hint: double-click to select code\">\n<div><code>$ ls ~\/.ssh<\/code><\/div>\n<div><code>id_rsa\u00a0 id_rsa.pub\u00a0<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<p>The command created two files, one for the public key (\u00a0for example\u00a0<code>id_rsa.pub<\/code>\u00a0) and one for the private key (for example,\u00a0<code>id_rsa<\/code>\u00a0).<\/li>\n<\/ol>\n<h2 id=\"SetupSSHforGit-Step4.CreateaSSHconfigfile\">Step 4. Create a SSH config file<\/h2>\n<p>&nbsp;<\/p>\n<ol>\n<li>Using your favorite text editor, edit an existing (or create a new)\u00a0<code>~\/.ssh\/config<\/code>\u00a0file.<\/li>\n<li>Add an entry to the configuration file using the following format:<code>Host bitbucket.org\u00a0<\/code><br \/>\n<code>\u00a0IdentityFile ~\/.ssh\/<em>privatekeyfile<\/em><\/code>The second line is indented. That indentation (a single space) is important, so make sure you include it. \u00a0The second line is the location of your private key file. \u00a0If you are following along with these instructions, your file is here:<\/p>\n<pre>\u00a0~\/.ssh\/id_rsa<\/pre>\n<p>When you are done editing, your configuration looks similar to the following:<\/p>\n<div>\n<div>\n<pre>Host bitbucket.org\r\n IdentityFile ~\/.ssh\/id_rsa<\/pre>\n<\/div>\n<\/div>\n<\/li>\n<li>Save and close the file.<\/li>\n<li>Restart the GitBash terminal.<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<h2 id=\"SetupSSHforGit-Step5.Updateyour.bashrcprofilefile\">Step 5. Update your .bashrc profile file<\/h2>\n<p>It is a good idea to configure your GitBash shell to automatically start the agent when launch the shell. \u00a0The\u00a0<code>.bashrc<\/code>\u00a0file is the shell initialization file. It contains commands that run each time your GitBash shell starts. \u00a0You can add commands to the\u00a0<code>.bashrc<\/code>\u00a0file that start the agent when you start GitBash. The folks at GitHub have developed a nice script for this (their script was developed from\u00a0<a href=\"http:\/\/www.cygwin.com\/ml\/cygwin\/2001-06\/msg00537.html\" rel=\"nofollow\">a post by Joseph M. Reagle Jr. from MIT<\/a>\u00a0on the cygwin list). To start the agent automatically, do the following.<\/p>\n<ol>\n<li>Start GitBash.<\/li>\n<li>Edit your\u00a0<code>~\/.bashrc<\/code>\u00a0file.If you don&#8217;t have a\u00a0<code>.bashrc<\/code>\u00a0file you can create the file using your favorite text editor. Keep in mind the file must be in your\u00a0<code>~<\/code>\u00a0(home) directory and must be named exactly\u00a0<em>.<\/em><code>bashrc<\/code>.<\/li>\n<li>Add the following lines to the file:\n<div>Icon<\/p>\n<div>\n<p>Chrome and Opera introduce ASCII \\xa0 (non-breaking space characters) on paste that can appear in your destination file. If you copy and paste the lines below, copy from another browser to avoid this problem.<\/p>\n<\/div>\n<\/div>\n<div>\n<div>\n<div id=\"highlighter_16776\">\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td>\n<div title=\"Hint: double-click to select code\">\n<div><code>SSH_ENV=$HOME\/.<\/code><code>ssh<\/code><code>\/environment<\/code><\/div>\n<div><code>\u00a0\u00a0<\/code><\/div>\n<div><code># start the ssh-agent<\/code><\/div>\n<div><code>function<\/code> <code>start_agent {<\/code><\/div>\n<div><code>\u00a0\u00a0\u00a0\u00a0<\/code><code>echo<\/code> <code>\"Initializing new SSH agent...\"<\/code><\/div>\n<div><code>\u00a0\u00a0\u00a0\u00a0<\/code><code># spawn ssh-agent<\/code><\/div>\n<div><code>\u00a0\u00a0\u00a0\u00a0<\/code><code>\/usr\/bin\/ssh-agent<\/code> <code>| <\/code><code>sed<\/code> <code>'s\/^echo\/#echo\/'<\/code> <code>&gt; ${SSH_ENV}<\/code><\/div>\n<div><code>\u00a0\u00a0\u00a0\u00a0<\/code><code>echo<\/code> <code>succeeded<\/code><\/div>\n<div><code>\u00a0\u00a0\u00a0\u00a0<\/code><code>chmod<\/code> <code>600 ${SSH_ENV}<\/code><\/div>\n<div><code>\u00a0\u00a0\u00a0\u00a0<\/code><code>. ${SSH_ENV} &gt; <\/code><code>\/dev\/null<\/code><\/div>\n<div><code>\u00a0\u00a0\u00a0\u00a0<\/code><code>\/usr\/bin\/ssh-add<\/code><\/div>\n<div><code>}<\/code><\/div>\n<div><code>\u00a0\u00a0<\/code><\/div>\n<div><code>if<\/code> <code>[ -f <\/code><code>\"${SSH_ENV}\"<\/code> <code>]; <\/code><code>then<\/code><\/div>\n<div><code>\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code>. ${SSH_ENV} &gt; <\/code><code>\/dev\/null<\/code><\/div>\n<div><code>\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code>ps<\/code> <code>-ef | <\/code><code>grep<\/code> <code>${SSH_AGENT_PID} | <\/code><code>grep<\/code> <code>ssh<\/code><code>-agent$ &gt; <\/code><code>\/dev\/null<\/code> <code>|| {<\/code><\/div>\n<div><code>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code>start_agent;<\/code><\/div>\n<div><code>\u00a0\u00a0\u00a0\u00a0<\/code><code>}<\/code><\/div>\n<div><code>else<\/code><\/div>\n<div><code>\u00a0\u00a0\u00a0\u00a0<\/code><code>start_agent;<\/code><\/div>\n<div><code>fi<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<\/li>\n<li>Save and close the file.<\/li>\n<li>Close GitBash.<\/li>\n<li>Reopen GitBash.<br \/>\nThe system prompts you for your passphrase:<\/p>\n<div>\n<div>\n<pre>Welcome to Git (version 1.7.8-preview20111206)\r\nRun 'git help git' to display the help index.\r\nRun 'git help &lt;command&gt;' to display help for specific commands.\r\nEnter passphrase for \/c\/Documents and Settings\/manthony\/.ssh\/id_rsa:<\/pre>\n<\/div>\n<\/div>\n<\/li>\n<li>Enter your passphrase.<br \/>\nAfter accepting your passphrase, the system displays the command shell prompt.<\/li>\n<li>Verify that the script identity added your identity successfully by querying the SSH agent:\n<div>\n<div>\n<div id=\"highlighter_760179\">\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td>\n<div title=\"Hint: double-click to select code\">\n<div><code>$ ssh-add -l<\/code><\/div>\n<div><code>2048<\/code> <code>0f:<\/code><code>37<\/code><code>:<\/code><code>21<\/code><code>:af:1b:<\/code><code>31<\/code><code>:d5:cd:<\/code><code>65<\/code><code>:<\/code><code>58<\/code><code>:b2:<\/code><code>68<\/code><code>:4a:ba:a2:<\/code><code>46<\/code> <code>\/Users\/manthony\/.ssh\/id_rsa (RSA)<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<p>After you install your public key to Bitbucket, having this script should prevent you from having to enter a password each time you push or pull a repository from Bitbucket.<\/p>\n<h2 id=\"SetupSSHforGit-#installpublickeyStep6.InstallthepublickeyonyourBitbucketaccount\">Step 6. Install the public key on your Bitbucket account<\/h2>\n<ol>\n<li>Open a browser and log into Bitbucket.<\/li>\n<li>Choose\u00a0<strong><em>avatar<\/em>\u00a0&gt; Manage Account<\/strong>\u00a0from the menu bar.<br \/>\nThe system displays the\u00a0<strong>Account settings<\/strong>\u00a0page.<\/li>\n<li>Click\u00a0<strong>SSH keys<\/strong>.<br \/>\nThe<strong>\u00a0SSH Keys<\/strong>\u00a0page displays. It shows a list of any existing keys. Then, below that, a dialog for labeling and entering a new key.<\/li>\n<li>In your terminal window,\u00a0<code>cat<\/code>\u00a0the contents of the public key file.<br \/>\nFor example:<\/p>\n<div>\n<div>\n<pre>cat ~\/.ssh\/id_rsa.pub<\/pre>\n<\/div>\n<\/div>\n<\/li>\n<li>Select and copy the key output in the clipboard.<br \/>\nIf you have problems with copy and paste, you can open the file directly with Notepad. Select the contents of the file (just avoid selecting the end-of-file character).<\/li>\n<li>Back in your browser, enter a\u00a0<strong>Label<\/strong>\u00a0for your new key, for example,\u00a0<code>Default public key<\/code>.<\/li>\n<li>Paste the copied public key into the\u00a0<strong>SSH Key<\/strong>\u00a0field.<\/li>\n<li>Click the\u00a0<strong>Add key<\/strong>\u00a0button:<br \/>\n<img alt=\"\" src=\"https:\/\/confluence.atlassian.com\/download\/attachments\/304578655\/ssh_key.png?version=1&amp;modificationDate=1349390094262&amp;api=v2&amp;effects=drop-shadow\" data-image-src=\"\/download\/attachments\/304578655\/ssh_key.png?version=1&amp;modificationDate=1349390094262&amp;api=v2&amp;effects=drop-shadow\" \/><br \/>\nThe system adds the key to your account.<\/li>\n<li>Return to the terminal window and verify your configuration by entering the following command.\n<div>\n<div>\n<pre>ssh -T git@bitbucket.org<\/pre>\n<\/div>\n<\/div>\n<p>The command message tells you which Bitbucket account can log in with that key.<\/p>\n<div>\n<div>\n<pre>conq: logged in as tutorials.\r\nYou can use git or hg to connect to Bitbucket. Shell access is disabled.<\/pre>\n<\/div>\n<\/div>\n<\/li>\n<li>Verify that the command returns your account name.\n<div id=\"expander-476235701\">\n<div id=\"expander-control-476235701\">\u00a0Click if you got a permission denied (publickey) message.<\/div>\n<\/div>\n<\/li>\n<\/ol>\n<h2 id=\"SetupSSHforGit-Step7.ConfigureyourrepositorytousetheSSHprotocol\">Step 7. Configure your repository to use the SSH protocol<\/h2>\n<p>The URL you use for a repository depends on which protocol you are using, HTTPS and SSH. The Bitbucket repository\u00a0<strong>Overview<\/strong>\u00a0page has a quick way for you to see the one for your\u00a0<code>bb101repo<\/code>\u00a0repo. On the repository&#8217;s\u00a0<strong>Overview<\/strong>\u00a0page look for the\u00a0<strong>Clone this repository<\/strong>\u00a0line.<\/p>\n<p><img alt=\"\" src=\"https:\/\/confluence.atlassian.com\/download\/attachments\/304578655\/protocol.png?version=1&amp;modificationDate=1349481895972&amp;api=v2&amp;effects=drop-shadow\" data-image-src=\"\/download\/attachments\/304578655\/protocol.png?version=1&amp;modificationDate=1349481895972&amp;api=v2&amp;effects=drop-shadow\" \/><\/p>\n<p>Experiment for a moment, click back and forth between the\u00a0<strong>SSH<\/strong>\u00a0and the\u00a0<strong>HTTPS<\/strong>\u00a0protocol links to see how the URLs differ. The table below shows the format for each DVCS based on protocol.<\/p>\n<p>&nbsp;<\/p>\n<div>\n<table>\n<thead>\n<tr>\n<th data-column=\"0\"><\/th>\n<th data-column=\"1\">\n<div>SSH\u00a0URL format<\/div>\n<\/th>\n<th data-column=\"2\">\n<div>HTTPS URL format<\/div>\n<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td colspan=\"1\" data-highlight-colour=\"grey\">Mercurial<\/td>\n<td colspan=\"1\"><code>ssh:\/\/hg@bitbucket.org\/<code><em>accountname<\/em><\/code>\/<em>reponame<\/em>\/<\/code><\/td>\n<td colspan=\"1\"><code>https:\/\/<em>accountname<\/em>@bitbucket.org\/<em>accountname<\/em>\/<em>reponame<\/em><\/code><\/td>\n<\/tr>\n<tr>\n<td data-highlight-colour=\"grey\">Git<\/td>\n<td><code>git@bitbucket.org<em>:accountname<\/em>\/<em>reponame<\/em>.git<\/code><strong><em>or<\/em><\/strong><code>ssh:\/\/git@bitbucket.org<em>\/accountname<\/em>\/<em>reponame<\/em>.git<\/code><\/td>\n<td><code>https:\/\/<em>accountname<\/em>@bitbucket.org\/<em>accountname<\/em>\/<em>reponame<\/em>.git<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>In the SSH format, the\u00a0<code>accountname<\/code>\u00a0appears\u00a0<em>after\u00a0<\/em><code>git@bitbucket.org<\/code>\u00a0or\u00a0<code>hg@bitbucket.org<\/code>. In HTTPS format, the\u00a0<code>accountname<\/code><em>\u00a0before<\/em><code>git@bitbucket.org<\/code>\u00a0or\u00a0<code>hg@bitbucket.org<\/code>.<\/p>\n<p>&nbsp;<\/p>\n<p>Go to terminal on your local system and navigate to your\u00a0<code>bb101repo-practice<\/code>\u00a0repository. Then, do the following:<\/p>\n<div>\n<div>\n<div>\n<ol>\n<li>View your current repository configuration.<br \/>\nYou should see something similar to the following:<\/p>\n<div>\n<div>\n<pre>manthony@MANTHONY-PC ~ \r\n$ cat .git\/config\r\n[core]\r\n  repositoryformatversion = 0\r\n  filemode = true\r\n  bare = false\r\n  logallrefupdates = true\r\n  ignorecase = true\r\n[remote \"origin\"]\r\n  fetch = +refs\/heads\/*:refs\/remotes\/origin\/*\r\n  url = https:\/\/newuserme@bitbucket.org\/newuserme\/bb101repo.git\r\n[branch \"master\"]\r\n  remote = origin\r\n  merge = refs\/heads\/master<\/pre>\n<\/div>\n<\/div>\n<p>&nbsp;<\/p>\n<p>As you can see, the\u00a0<code>url<\/code>\u00a0is using the HTTPS protocol. There are a number of ways to change this value, the easiest way is just to edit the repository&#8217;s configuration file.<\/li>\n<li>Edit the<code>\u00a0~\/repos\/bb101repo-practice\/.git\/config<\/code>\u00a0file with your favorite editor.<\/li>\n<li>Change the\u00a0<code>url<\/code>\u00a0value to use the SSH format for that repository.<br \/>\nWhen you are done the\u00a0<code>origin<\/code>\u00a0section should contain something similar to the following:<\/p>\n<div>\n<div>\n<pre>[remote \"origin\"]\r\n  fetch = +refs\/heads\/*:refs\/remotes\/origin\/*\r\n  url = git@bitbucket.org:newuserme\/bb101repo.git<\/pre>\n<\/div>\n<\/div>\n<\/li>\n<li>Save your edits and close the file.<\/li>\n<\/ol>\n<\/div>\n<\/div>\n<\/div>\n<h2 id=\"SetupSSHforGit-Step8.Makeachangeunderthenewprotocol\">Step 8. Make a change under the new protocol<\/h2>\n<ol>\n<li>Edit the\u00a0<code>README<\/code>\u00a0file in your\u00a0<code>bb101repo-practice<\/code>\u00a0repository.<\/li>\n<li>Add a new line to the file, for example:\n<div>\n<div>\n<pre>Welcome to My First Repo\r\n-------------------------------\r\nThis repo is a practice repo I am using to learn bitbucket.\r\nYou can access this repo with SSH or with HTTPS.<\/pre>\n<\/div>\n<\/div>\n<\/li>\n<li>Save and close the file.<\/li>\n<li>Add and then commit your change to your local repo.\n<div>\n<div>\n<pre>git add README\r\ngit commit -m \"making a change under the SSH protocol\"<\/pre>\n<\/div>\n<\/div>\n<\/li>\n<li>Push your changes.<br \/>\nThe system warns you that it is adding the Bitbucket host to the list of known hosts.<\/p>\n<div>\n<div>\n<pre>manthony@MANTHONY-PC ~\r\n$ git push \r\n$ git push\r\nCounting objects: 5, done.\r\nDelta compression using up to 2 threads.\r\nCompressing objects: 100% (2\/2), done.\r\nWriting objects: 100% (3\/3), 287 bytes, done.\r\nTotal 3 (delta 1), reused 0 (delta 0)\r\nremote: bb\/acl: newuserme is allowed. accepted payload.\r\nTo git@bitbucket.org:newuserme\/bb101repo.git\r\n  056c29c..205e9a8 master -&gt; master<\/pre>\n<\/div>\n<\/div>\n<\/li>\n<li>Open the repo\u00a0<strong>Overview<\/strong>\u00a0in Bitbucket to view your commit.<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<p><strong>Use PUTTYGEN to create ppk Key and link it under settings.<\/strong><\/p>\n<\/div>\n<\/div>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to get git with ssh authentication running, mostly borrowed from heroku.com.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":""},"categories":[88],"tags":[],"featured_image_src":null,"featured_image_src_square":null,"author_info":{"display_name":"Harald","author_link":"https:\/\/www.anagram.at\/en\/author\/admin\/"},"_links":{"self":[{"href":"https:\/\/www.anagram.at\/en\/wp-json\/wp\/v2\/posts\/2017"}],"collection":[{"href":"https:\/\/www.anagram.at\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.anagram.at\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.anagram.at\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.anagram.at\/en\/wp-json\/wp\/v2\/comments?post=2017"}],"version-history":[{"count":0,"href":"https:\/\/www.anagram.at\/en\/wp-json\/wp\/v2\/posts\/2017\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.anagram.at\/en\/wp-json\/wp\/v2\/media?parent=2017"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.anagram.at\/en\/wp-json\/wp\/v2\/categories?post=2017"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.anagram.at\/en\/wp-json\/wp\/v2\/tags?post=2017"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}