github导入文件操作

建立本地仓库:

 

创建新仓库的指令:

  git init //把这个目录变成Git可以管理的仓库
  git add README.md //文件添加到仓库
  git add . //不但可以跟单一文件,还可以跟通配符,更可以跟目录。一个点就把当前目录下所有未追踪的文件全部add了 
  git commit  "first commit" //把文件提交到仓库
  git remote add origin https://github.com/connordb/douban_img.git //关联远程仓库
  git push  origin master //把本地库的所有内容推送到远程库

首先在github创建一个仓库

Your repositories--new--douban_img(仓库名)

 

接下对库进行clone,如下:

输入:git clone https://github.com/connordb/douban_img.git

显示:

Cloning into 'douban_img'...
warning: You appear to have cloned an empty repository.

输入:git init

显示:

 

Initialized empty Git repository in E:/Python/爬虫/douban_imgs/.git/

 

本地创建一个README.md文件

  touch README.md
  git add README.md
  git commit -m 'first_commit'
  git remote add origin https://github.com/connordb/douban_img.git
  git push origin master

创建完README.md后,就可以push了

   git add .
  git commit -m 'first_commit'
  git remote add origin https://github.com/findingsea/myRepoForBlog.git
  git push origin master

这时候,我们就已经上传成功了!

 

 

posted @ 2018-11-21 15:31  时间带着假象流淌  阅读(535)  评论(0编辑  收藏  举报