<博客建立历程>阿里云建站11——通过github托管代码
目录:
GitHub 是一个面向开源及私有软件项目的托管平台,因为只支持 Git 作为唯一的版本库格式进行托管,故名 GitHub。
GitHub 上有好多好多大神的代码可以拿来借鉴,非常推荐,才疏学浅的博主只能看懂点简单的,愿以后强大起来~
github创建项目
添加ssh免密推送
推送代码到github
[root@why-1 ~]# cd mysite
[root@why-1 mysite]# ll
total 16
drwxr-xr-x 3 root root 4096 Nov 1 00:51 blog
-rwxr-xr-x 1 root root 249 Oct 20 21:38 manage.py
drwxr-xr-x 2 root root 4096 Nov 1 00:53 mysite
drwxr-xr-x 2 root root 4096 Nov 25 21:06 templates
[root@why-1 mysite]# echo "# blog" >> README.md
[root@why-1 mysite]# git init
Initialized empty Git repository in /root/mysite/.git/
[root@why-1 mysite]# git add README.md
[root@why-1 mysite]# git commit -m "first commit"
[master (root-commit) e9b1500] first commit
1 files changed, 1 insertions(+), 0 deletions(-)
create mode 100644 README.md
[root@why-1 mysite]# git remote add origin git@github.com:redhadoopwhy/blog.git
[root@why-1 mysite]# git push -u origin master
Counting objects: 3, done.
Writing objects: 100% (3/3), 217 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
To git@github.com:redhadoopwhy/blog.git
* [new branch] master -> master
Branch master set up to track remote branch master from origin.
[root@why-1 mysite]# git add .
[root@why-1 mysite]# git commit -m 'my blog first commit'
[master cd98b0c] my blog first commit
24 files changed, 406 insertions(+), 0 deletions(-)
create mode 100755 blog/__init__.py
create mode 100644 blog/__init__.pyc
create mode 100755 blog/admin.py
create mode 100755 blog/models.py
create mode 100644 blog/models.pyc
create mode 100644 blog/templatetags/__init__.py
create mode 100644 blog/templatetags/custom_markdown.py
create mode 100755 blog/tests.py
create mode 100644 blog/urls.py
create mode 100755 blog/views.py
create mode 100755 manage.py
create mode 100755 mysite/__init__.py
create mode 100755 mysite/__init__.pyc
create mode 100755 mysite/settings.py
create mode 100644 mysite/settings.pyc
create mode 100755 mysite/urls.py
create mode 100644 mysite/views.py
create mode 100755 mysite/wsgi.py
create mode 100644 templates/blog.html
create mode 100644 templates/blog_base.html
create mode 100644 templates/blog_base.html.old.green
create mode 100644 templates/blog_every.html
create mode 100644 templates/blog_every_tag.html
create mode 100644 templates/blog_post.html
create mode 100644 templates/blog_tag.html
create mode 100644 templates/favicon.ico
create mode 100644 templates/index.html
[root@why-1 mysite]# git push -u origin master
Counting objects: 32, done.
Compressing objects: 100% (30/30), done.
Writing objects: 100% (31/31), 9.45 KiB, done.
Total 31 (delta 2), reused 0 (delta 0)
remote: Resolving deltas: 100% (2/2), done.
To git@github.com:redhadoopwhy/blog.git
e9b1500..cd98b0c master -> master
Branch master set up to track remote branch master from origin.