首次使用Git與github的項(xiàng)目聯(lián)系在一起
首先在github上創(chuàng)建了項(xiàng)目python-recsys
本地拉取代碼
git clone https://github.com/El-anqiao/python-recsys.git
初始化項(xiàng)目
進(jìn)入項(xiàng)目文件
git init
提示:Reinitialized existing Git repository in F:/pythoner/python-recsys/.git/
添加項(xiàng)目
git add .
.指全部文件
提交項(xiàng)目
git commit -m 'test'
提示:Your branch is up-to-date with 'origin/master'.
nothing to commit, working tree clean
本地項(xiàng)目與遠(yuǎn)程git倉(cāng)庫(kù)關(guān)聯(lián)
git remote add origin https://github.com/El-anqiao/python-recsys.git
提示:fatal: remote origin already exists.
push本地項(xiàng)目到倉(cāng)庫(kù)
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
沒(méi)有任何更新哲虾,咋辦呢?
別急骨望,這時(shí)候git服務(wù)器倉(cāng)庫(kù)是完全空的楣铁,創(chuàng)建個(gè)分支
git branch
* master
在本地git commit -m 'test'后卤妒,再執(zhí)行g(shù)it push origin master