获得密钥:
ssh-keygen -t rsa -C "aa@aa.com"
链接github
aa@aa:~/dema$ ssh -T git@github.com
Hi username! You've successfully authenticated, but GitHub does not provide shell access.
设置用户名和邮箱
aa@aa:~/demo$ git config --global user.name "username"
aa@aa:~/demo$ git config --global user.email "email@163.com"
上传工程
aa@aa:~/demo$ git add .
aa@aa:~/demo$ git commit -m 'add demo product'
[master (root-commit) 3ca3972] add demo product
69 files changed, 1840 insertions(+)
create mode 100644 app/controllers/application_controller.rb
create mode 100644 app/controllers/blogs_controller.rb
create mode 100644 app/helpers/application_helper.rb
create mode 100644 app/helpers/blogs_helper.rb
create mode 100644 app/models/blog.rb
create mode 100644 app/views/blogs/show.html.erb
create mode 100644 doc/README_FOR_APP
create mode 100644 lib/assets/.gitkeep
create mode 100644 log/.gitkeep
create mode 100644 public/404.html
aa@aa:~/demo$ git remote add origin https://github.com/username/demo.git
aa@aa:~/demo$ git push -u origin master
Username for 'https://github.com': username
Password for 'https://username@github.com':
Counting objects: 101, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (90/90), done.
Writing objects: 100% (101/101), 32.20 KiB, done.
Total 101 (delta 9), reused 0 (delta 0)
To https://github.com/username/demo.git
github errors
aa@aa:~/demo$ git init
Reinitialized existing Git repository in /home/aa/demo/.git/
aa@aa:~/demo$ git remote add origin https://github.com/username/demo.git
fatal: remote origin already exists.
aa@aa:~/demo$ git push -u origin master
ERROR: Repository not found.
fatal: The remote end hung up unexpectedly
aa@aa:~/demo$ git remote rm origin
aa@aa:~/demo$ git remote add origin https://github.com/username/demo.git