一、 首先註冊git
php
最終生成三個文件:就是一些版權和申明。git
git init
此時win+R打開cmd,進入咱們本地工程目錄,在該目錄下已經存在一個.py文件,此時輸入該命令,會出現git的文件夾(隱藏的,只能查看隱藏文件才能夠看到),表示當前工程目錄變成了git倉庫。
github
git status
查看狀態
git add .
固然,咱們也能夠指定文件的添加,好比:git add num.pyshell
git commit -m "first commit"
不論是修改仍是從新提交,這一步都須要,並且first commit能夠依次改爲second commit。
假如這一步出現問題以下:
「 *** Please tell me who you are.
Run
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
to set your account's default identity.
Omit --global to set the identity only in this repository.
fatal: unable to auto-detect email address (got 'lym@LYM-PC.(none)')
」
此時說明沒有關聯你的帳戶信息,進行關聯皆能夠了。瀏覽器
git config --global user.email "you@example.com" git config --global user.name "Your Name"
git remote add origin https://github.com/zlxzlxzlx/Test.git
bash
git pull --rebase origin master
或者git push -u origin master(反正本身發現不對,查資料發知道github中的README.md文件不在本地代碼目錄中,因此這條命令不對,要是提早本地倉庫有README.md,就能夠用。能夠在步驟5以前使用git clone https://github.com/saucxs/BPS.git下載README.md到本地)
先將遠程倉庫的三個文件下載到本地,保證本地和遠程的是同樣的。
ssh
git push -u origin master
此時遠程Github倉庫也有咱們上傳的文件了。
ide
git status
網站
git add *
this
git commit -m "更新說明"
git pull
git push origin master
不出意外,打開GitHub已經同步了
git clone https://github.com/lymwpc/phoneemail_etxact.git
一、最好是用谷歌瀏覽器,Github網站對別的瀏覽器不太支持。 二、README.md文件很重要,是一種maekdown格式縮寫.md,用以存儲咱們想要說明的信息,能夠本身編寫。