github 下载安装等基本步骤
老是忘记github的相关操作,系统地整理下,方便后续使用。
- github桌面下载
- github删除仓库
- github分支操作
- github网页形式查看效果(利用分支,远程,本地仓库)
github桌面下载
从该网站下载 GithubDesktop
下载安装包后,双击安装
结果安装出现了错误。
An error occurred trying to download :’http://github-windows.s3.amazonaws.com/GitHub.application‘.
解决方案:
http://github-windows.s3.amazonaws.com/GitHub.application 改成 https://github-windows.s3.amazonaws.com/GitHub.application 。用IE浏览器打开该链接,自动下载后就可以安装了。
安装成功,桌面出现了github和git shell两个图标
Git Shell的用法和Git Bash 差不多,GitHub桌面exe可以实现进行无命令的可视化界面操作。
登入验证信息(github账号密码)
关于GitHub桌面版有博文详细介绍啦!
github之无命令可视化界面操作——GitHub DeskTop
github删除仓库
该应用源于自己刚开始用github的时候,很多空仓库,嗯,是该处理处理了。
进入个人的github页面,找到要删除的仓库
点击setting跳转后,用鼠标滚到页面底部,就能看见Delete选项了。
删除成功!
github分支操作
如何使用git创建分支,查看分支,切换分支,合并分支等功能
//创建分支branch_1
G:\git1001 [master +0 ~0 -4 !]> git branch branch_1
G:\git1001 [master +0 ~0 -4 !]> git branch
//显示版本库中所有分支,其中分支名称前带*的为当前分支,如图master为当前所处分支:
branch_1
* master
//切换到branch_1分支,切换后branch_1为当前分支,可以通过git branch命令查看
G:\git1001 [master +0 ~0 -4 !G:\git1001 [master +0 ~0 -4 !]> git checkout branch_1
D fractal
D tree/canvas_tree.html
D tree/canvas_window_size.html
D tree/js/jquery.js
Switched to branch 'branch_1']>
//再次查看当前分支,现在当前分支已经是branch_1
G:\git1001 [branch_1 +0 ~0 -4 !]> git branch
* branch_1
master
//合并分支
git merge master
//撤回合并分支
git merge --abort
github网页形式查看效果(利用分支,远程,本地仓库)
自己重新整理了下shell的操作步骤!
1 在本地创建一个文件夹git-test
G:\git1001 [master +0 ~0 -4 !]> cd g:\
G:\ [gh-pages +24 ~0 -0 !]> mkdir git-test
2 将在github官网上创建的新仓库克隆到git-test文件夹中。(新仓库具体参考“网页形式教程,大图易懂”)
//进入git-test 文件内
G:\ [gh-pages +24 ~0 -0 !]> cd git-test
//将创建的canvas仓库克隆到git-test文件夹中
G:\git-test [gh-pages +24 ~0 -0 !]> git clone https://github.com/LianJion/canvas.git
Cloning into 'canvas'...
remote: Counting objects: 59, done.
remote: Compressing objects: 100% (56/56), done.
Uremote: Total 59 (delta 1), reused 0 (delta 0), pack-reused 0
ts: 81% (48/59)
Unpacking objects: 100% (59/59), done.
3.git-test文件夹下有了canvas文件,此时canvas里面是README.md,不是我们想要的分支文件。
4.切换分支下的文件
//进入仓库里
G:\git-test [gh-pages +24 ~0 -0 !]> cd canvas
//切换分支(下面语句如果第一次失败,可以多试几次)
G:\git-test\canvas [master ≡]> git checkout -b gh-pages origin/gh-pages
Branch gh-pages set up to track remote branch gh-pages from origin.
Switched to a new branch 'gh-pages'
G:\git-test\canvas [gh-pages ≡]>
这就是我们要的效果
5.删除这些文件,添加我们要上传的文件内容
G:\git-test\canvas [gh-pages ≡]> git rm -rf .
rm 'fonts/opensans-bold-webfont.eot'
rm 'fonts/opensans-bold-webfont.svg'
rm 'fonts/opensans-bold-webfont.ttf'
rm 'fonts/opensans-bold-webfont.woff'
rm 'fonts/opensans-bolditalic-webfont.eot'
rm 'fonts/opensans-bolditalic-webfont.svg'
rm 'fonts/opensans-bolditalic-webfont.ttf'
rm 'fonts/opensans-bolditalic-webfont.woff'
rm 'fonts/opensans-extrabold-webfont.eot'
rm 'fonts/opensans-extrabold-webfont.svg'
rm 'fonts/opensans-extrabold-webfont.ttf'
rm 'fonts/opensans-extrabold-webfont.woff'
rm 'fonts/opensans-italic-webfont.eot'
rm 'fonts/opensans-italic-webfont.svg'
rm 'fonts/opensans-italic-webfont.ttf'
rm 'fonts/opensans-italic-webfont.woff'
rm 'fonts/opensans-regular-webfont.eot'
rm 'fonts/opensans-regular-webfont.svg'
rm 'fonts/opensans-regular-webfont.ttf'
rm 'fonts/opensans-regular-webfont.woff'
rm 'images/bg-ramp.jpg'
rm 'images/blockquote-gfx-2x.png'
rm 'images/blockquote-gfx.png'
rm 'images/chevron-2x.png'
rm 'images/chevron.png'
rm 'images/download-fallback-bg.png'
rm 'images/download-sprite.png'
rm 'images/footer-ramp.jpg'
rm 'images/fork-sprite.png'
rm 'images/hr-2x.jpg'
rm 'images/hr.jpg'
rm 'images/octocat-2x.png'
rm 'images/octocat.png'
rm 'images/ribbon-tail-sprite-2x.png'
rm 'images/ribbon-tail-sprite.png'
rm 'images/shield-fallback.png'
rm 'images/shield.png'
rm 'images/site-2.png'
rm 'images/small-ribbon-tail-sprite-2x.png'
rm 'images/small-ribbon-tail-sprite.png'
rm 'index.html'
rm 'javascripts/headsmart.min.js'
rm 'javascripts/main.js'
rm 'javascripts/modernizr.js'
rm 'params.json'
rm 'stylesheets/core.css'
rm 'stylesheets/github-light.css'
rm 'stylesheets/mobile.css'
rm 'stylesheets/non-screen.css'
rm 'stylesheets/print.css'
rm 'stylesheets/screen.css'
G:\git-test\canvas [gh-pages ≡ +0 ~0 -51 ~]>
//写记录
G:\git-test\canvas [gh-pages ≡ +0 ~0 -51 ~]> git commit -m "delete"
将本地的tree文件夹拷入到canvas仓库中,并做记录
G:\git-test\canvas [gh-pages ↑ +1 ~0 -0 !]> git add .
G:\git-test\canvas [gh-pages ↑ +3 ~0 -0 ~]> git commit -m "add tree"
[gh-pages 83490d9] add tree
3 files changed, 356 insertions(+)
create mode 100644 tree/canvas_tree.html
create mode 100644 tree/canvas_window_size.html
create mode 100644 tree/js/jquery.js
6.将本地文件上传到远程仓库中
G:\git-test\canvas [gh-pages ↑]> git push origin gh-pages
Counting objects: 9, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (6/6), done.
Writing objects: 100% (9/9), 26.33 KiB | 0 bytes/s, done.
Total 9 (delta 1), reused 0 (delta 0)
remote: Resolving deltas: 100% (1/1), done.
//标志上传成功!
To https://github.com/LianJion/canvas.git
af13c65..83490d9 gh-pages -> gh-pages
7.查看网页的方法!
前面是一样的 https://lianjion.github.io/
接下来是仓库名 canvas
接下来就是自己上传的文件名 tree
最后就是 html文件 canvas_tree.html
https://lianjion.github.io/canvas/tree/canvas_tree.html
展示网页链接
参考资料:
http://www.cnblogs.com/ztoz/p/5515475.html
http://jingyan.baidu.com/article/215817f788f0c21eda1423f2.html
http://blog.csdn.net/steven6977/article/details/10567719
http://jingyan.baidu.com/article/f71d60377951651ab741d16f.html
http://blog.csdn.net/u011686226/article/details/51878340
https://desktop.github.com/