一、 同步幾種情況:
二、若干命令
git status 查看未提交本地以及本地未提交服務器的文件
git rm --cached [文件名] 在git中邏輯刪除,本地存在,只是git不跟蹤,記得git commit 提交一下
git rm -f [文件名] 強制刪除,本地還有git都刪除
git reset HEAD~1 回退上一步,不能回來,注意小波浪線是esc下面的鍵
git revert HEAD 撤銷更改,還能回來,有新節點記錄
git checkout 【newImage】 切換到新分支
三、報錯
git clone 報錯,原因 服務器未開啟ssh服務,22端口未開放
ssh: connect to host gitlab.app.guomeng.name port 22: Connection timed out fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
git push 報錯,原因服務器限制了上傳文件的大小,修改下服務的配置,比如私搭的服務器gitlab的配置
fatal: The remote end hung up unexpectedly fatal: The remote end hung up unexpectedly error: RPC failed; HTTP 413 curl 22 The requested URL returned error: 413 Request Entity Too Large Everything up-to-date
git push報錯,方案刪除項目下的.git文件夾,重新init來過
fatal: unable to access 'https://***/test.git/': Port number ended with 'y'
四、推薦個學習git的網站,圖形化命令,形象記憶

