gitHub

I did the following steps:

  1. goto http://github.com/ and click on 'sign up now!'
  2. Create new repository as shown below.
  3. install github on my local computer (I used the version that came with my SUSE distribution)
  4. If using Eclipse then follow the procedure on this page, otherwise:
  5. Create a local directory for files to be uploaded and 'cd directory'
  6. Generate ssh keys and put public key on github
  7. Upload files to github.

Create New Repository

on http://github.com/, having loged on, click on the 'New repository' button. github create new repository
Enter the repository name and click on create. create new repository
  create new repository

If you are using command line follow information below. If you are using Eclipse see this page.

More information about settitng up ssh keys

for more information see this website:
http://help.github.com/linux-key-setup/

I did the following, first change to the directory where the files to be uploadded are kept, then

name@computername:~/directory> ssh-keygen -t rsa -C "myname@domain.com"
  Generating public/private rsa key pair.
  Enter file in which to save the key (/.ssh/id_rsa):/$/directory/.ssh/id_rsa already exists.
  Overwrite (y/n)? y
  Enter passphrase (empty for no passphrase):
  Enter same passphrase again:
  Your identification has been saved in /.ssh/id_rsa.
  Your public key has been saved in /.ssh/id_rsa.pub.
  The key fingerprint is:
  ??:??:??:??:??:??:??:??:??:??:??:??:??:??:??:?? myname@domain.com
  The key's randomart image is:
  +--[ RSA 2048]----+
  | ??????????????? |
  | ??????????????? |
  | ??????????????? |
  | ??????????????? |
  | ??????????????? |
  | ??????????????? |
  | ??????????????? |
  | ??????????????? |
  | ??????????????? |
  +-----------------+

Once the ssh key has been generated then cut and paste the whole content of the file (id_rsa.pub not id_rsa) to github. Login to github and paste whole file into Account Settings -> SSH public keys.

If you have any problems, or to check if it works, try:

> ssh -v git@github.com
OpenSSH_5.2p1, OpenSSL 0.9.8k 25 Mar 2009
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to github.com [207.97.227.239] port 22.
debug1: Connection established.
debug1: identity file/$/directory/.ssh/id_rsa type -1
debug1: identity file/$/directory/.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.1p1 Debian-5github2
debug1: match: OpenSSH_5.1p1 Debian-5github2 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.2
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host 'github.com' is known and matches the RSA host key.
debug1: Found key in/$/directory/.ssh/known_hosts:1
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Trying private key:/$/directory/.ssh/id_rsa
debug1: Trying private key:/$/directory/.ssh/id_dsa
debug1: No more authentication methods to try.
Permission denied (publickey).
>

First upload

name@computername:~> cd myDirectoryName
> git config --global user.name "myLoginName"
> git config --global user.email myname@domain.com
> git init
Initialized empty Git repository in/$/directory/myDirectoryName/.git/
> touch clifford.spad.pamphlet
> git add clifford.spad.pamphlet
> git commit -m 'first commit'
[master (root-commit) 4b6fd51] first commit
1 files changed, 1039 insertions(+), 0 deletions(-)
create mode 100644 clifford.spad.pamphlet
> git remote add origin git@github.com:myLoginName/myDirectoryName.git
> git push origin master
The authenticity of host 'github.com (207.97.227.239)' can't be established.
RSA key fingerprint is 16:27:??:??:??:??:??:??:??:??:??:??:??:??:??:??.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'github.com,207.97.227.239' (RSA) to the list of known hosts.
Permission denied (publickey).
fatal: The remote end hung up unexpectedly

Following Uploads

name@computername:~> cd myDirectoryName
> git add clifford.spad.pamphlet
> git commit -m 'my second commit'
[master 832899a] my second commit
1 files changed, 40 insertions(+), 15 deletions(-)
> git push origin master
Counting objects: 5, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 1.19 KiB, done.
Total 3 (delta 1), reused 0 (delta 0)
To git@github.com:myLoginName/myDirectoryName.git
4b6fd51..832899a master -> master

Removing a file

> git rm clifford.spad.pamphlet


metadata block
see also:
Correspondence about this page

This site may have errors. Don't use for critical systems.

Copyright (c) 1998-2023 Martin John Baker - All rights reserved - privacy policy.