Git与github的项目联系

首次使用Git与github的项目联系在一起

首先在github上创建了项目python-recsys

本地拉取代码

git clone https://github.com/El-anqiao/python-recsys.git

初始化项目

进入项目文件

git init

提示:Reinitialized existing Git repository in F:/pythoner/python-recsys/.git/

添加项目

git add .

.指全部文件

提交项目

git commit -m 'test'

提示:Your branch is up-to-date with 'origin/master'.

nothing to commit, working tree clean

本地项目与远程git仓库关联

git remote add origin https://github.com/El-anqiao/python-recsys.git
提示:fatal: remote origin already exists.

push本地项目到仓库

git push -u origin master

Username for 'https://github.com': El-anqiao

Password for 'https://El-anqiao@github.com':

提示:Branch master set up to track remote branch master from origin.

Everything up-to-date

没有任何更新,咋办呢?

别急,这时候git服务器仓库是完全空的,创建个分支

git branch

* master


在本地git commit -m 'test'后,再执行git push origin master

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • Lesson 3: Using GitHub to Collaborate 3.1 Creating a GitH...
    赤乐君阅读 6,181评论 3 11
  • 1.git的安装 1.1 在Windows上安装Git msysgit是Windows版的Git,从https:/...
    落魂灬阅读 12,726评论 4 54
  • git常用命令 GIT常用命令备忘:http://stormzhang.com/git/2014/01/27/gi...
    新篇章阅读 8,661评论 1 26
  • 晚上放学路上还好端端的,回到家闺女突然说肚子疼,我忙着在厨房做饭,也没有空搭理她,心想不会是她无病呻吟吧? 正好她...
    邱Q糖阅读 533评论 0 1
  • 我很难过。十四天的阅读训练结束了,想着写一下自己的读书心得但是一直写不出来,感觉自己脑子里面没有东西,自己难过又难...
    汤圆是圆的圆阅读 183评论 0 0