1. register an account on Github.
https://github.com/
2. Login your account and click "create a new repo" around top left corner of the page.
All you need is a project name for now.
3. Prepare ssh-keygen at ubuntu:
a. Open terminal and run:
cd ~/.ssh
b. Backup your current id_rsa, and remove it after:
mkdir key_backup
cp id_rsa key_backup
rm id_rsa
c. Generate a new SSH key
ssh-keygen -t rsa -C "your_email_used_in_step_1@youremail.com"
d. Keep default setting and type your password in step 1.
e. Copy your public key:
gedit id_rsa.pub
ctrl+a and ctrl+c
f. Go to "SSH Keys" page and click "Add SSH key", ctrl+v at "Key" field, leave "Title" blank. Click "Add key" after.
https://github.com/settings/ssh
g. Make sure you did all a.-f. , re-login your account
h. Test SSH, it should work.
ssh -T git@github.com
4. Install git on your ubuntu
5. Setting up Git:
git config --global user.name "Your Name Here"
git config --global user.email "your_email@youremail.com"
git config --global credential.helper cache
6. Uploading your project, go to your root directory of your project, and perform:
git init
git add .
git commit -m "init"
git remote add origin git@github.com:<username>/<projectname>.git
git push -f