Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Here is a bit of a check list:</p> <ol> <li>Is ssh enabled on the server you are trying to connect to?</li> <li>Is GIT installed on the server?</li> <li>Do you have a Git repository set-up on the server?</li> <li>Does the repository the correct permissions and have sharedrepository enabled in the config on the server?</li> <li><p>Do you have the ssh keys in the right place for GIT?</p> <p><strong>Suggestions:</strong></p></li> </ol> <p>1: Since you can connect using putty, looks like ssh is setup ok.</p> <p>2: Use putty and connect to the server. Type in <code>git --version</code> Do you get back a reasonable response? If not then you will need to install it on the server. </p> <p>3:Try setting up a new repository on the server. Assuming its a *nix style server use putty and connect to the server and make a new repository using the following commands, assuming you have a directory /home/source_code. The echo line just makes a file with a little bit of text in it so we have something to start with. </p> <pre><code>cd /home/source_code mkdir test_repo cd /home/source_code/test_repo echo "first file" &gt; t.txt git init git add . git commit -m "Initial Import" </code></pre> <p>So now we have a repository with one t.txt file in it. As a rule you should never push into a repository that contains changes to the working copy. The purpose of having a repository on the server is so that people can push into it all the time. We make a "bare" clone which is only the git database, that way there is no possibility of any working copy changes. It is this "bare" clone that we will use as the central git repository. </p> <pre><code>cd /home/source_code git clone --bare test_repo/ test_repo.git </code></pre> <p>You can now get rid of the temporary repository that we set up. </p> <pre><code>cd /home/source_code/ rm -rf test_repo </code></pre> <p>On your local computer try cloning again</p> <pre><code>git clone ssh://user@host.com:port/home/source_code/test_repo.git </code></pre> <p>4: Permissions: This should not cause a problem with cloning, fetching or pulling, unless you have selected a location for the repository that doesnt have read access. If you get a Permission denied error when pushing back then refer to <a href="http://kerneltrap.org/index.php?q=mailarchive/git/2008/10/9/3569854/thread" rel="noreferrer" title="GIT permissions correction">Permissions correction</a></p> <p>5: Setting up public/private key for GIT:</p> <ol> <li>Connect to the server with putty</li> <li>Set permissions on your ~/.ssh folder: <code>chmod 700 .ssh</code></li> <li>Set permissions on your ~/.ssh/authorized_keys: <code>chmod 600 authorized_keys</code></li> <li>Generate the keys <code>ssh-keygen -t dsa</code></li> <li>Accept the file names it wants to use</li> <li>Don't enter a passphrase (just enter). You will want to redo do this with a passphrase later. </li> <li>add the pub key to the authorized_keys file: <code>cat id_dsa.pub &gt;&gt; .ssh/authorized_keys</code></li> <li>edit /etc/ssh/ssh_config and add the line <code>PubkeyAuthentication yes</code></li> <li>restart the ssh daemon <code>sudo /etc/init.d/ssh restart</code></li> <li>Copy <code>id_dsa</code> and <code>id_dsa.pub</code> from the server to your local hard drive (use winscp or sftp or some such tool) c:\users\userName\.ssh directory (this is for vista the location will be a bit different for other versions of windows)</li> <li>Set tortoise git to point to C:\Program Files\Git\bin\ssh.exe (not putty)</li> </ol> <p>Both the command line git and tortoise git should be setup to work. Try cloning again on your local machine. </p> <pre><code>git clone ssh://user@host.com:port/home/source_code/test_repo.git </code></pre> <p>You might now want to go and repeat setting up the keys with a passphrase.... </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload