首次使用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