这几天写了很多零碎的代码,开始想直接一分类上传到网盘保存。后来发现又想用的时候,需要下载,解压。今天集成jquery一个开源上传框架,想到将这些零碎的代码上传到github上。这样看也方便,如果有需要的还可以参考一下我写的代码(虽然很乱,其实也是水平所限)。自己写过贴代码的网站不难,只是这个轮子没必要造了。开搞。。 第一步:注册。注册完了,你会看到一个GitHub Bootcamp,在正中央。哈哈,我提前先从网上找了教程瞅了几眼,虽然一直喜欢 碰到一个新东西,先蒙头研究一番,但是感觉在这里很谨慎。大部分网站喜欢把帮助文件放到一边,这可能与github需要很多操作有关。 第二步:下载git。下载地址:http://git-scm.com/download/win,安装。 设置: 用户名和邮箱
git config --global user.name "Your Name Here"
git config --global user.email "your_email@youremail.com"

设置密码过期时间一小时:
git config --global credential.helper cache
git config --global credential.helper 'cache --timeout=3600'# Set the cache to timeout after 1 hour (setting is in seconds) 第三步:创建一个项目。https://github.com/repositories/new 配置密钥 git push origin master 生成新密钥 ssh-keygen –t rsa –C “a.0x55aa@gmai.com” 复制.ssh\id_rsa.pub文件内容到 Account Settings--->SSH keys ,add ssh key,就搞定了
第四步:上传代码。 进入本地项目创建的文件夹(命令有linux命令一样),执行命令。
git init
git clone git@github.com:0x55aa/django-image-upload
将github上的文件clone到本地,我在创建项目的时候选择了自动生成readme文件。所以这里先update一下。
如果是直接创建,需要$ git remote add origin git@github.com:0x55aa/django-image-upload
git remote -v
查看你当前项目远程连接的是哪个仓库地址
git add .
向项目添加文件
git commit –m ”new” 
更新
git push origin master
上传文件

步骤再记录下,前面有点乱。
 git clone git@github.com:0x55aa/baidu-tieba-tools
D:\git>cd baidu-tieba-tools
D:\git\baidu-tieba-tools>git add . 
git commit -m "first"
git push -u origin master
搞定
 
git config --global credential.helper 'cache --timeout=3600'# Set the cache to timeout after 1 hour (setting is in seconds)

上一篇:
下一篇:

相关文章:

Categories: 博客记录

0 Responses so far.

Leave a Reply