Git 上傳本地檔案

2022-06-17 22:00:22 字數 635 閱讀 7679

開啟終端,進入想要的檔案目錄下

git init //初始化git倉庫

git add . //將該目錄所有東西傳到快取區

git commit -m 」提交說明「 //將快取區的東西傳到本地倉庫

git romete add origin //新增遠端版本庫

git push -u origin master //第一次推送 使用了-u

git push origin master //以後可以用這個簡便一點

解決辦法就是執行如下命令

git pull --rebase origin master

這個命令的就是說的 從遠端倉庫 clone 來的專案裡包含了readme.md這個檔案,但是自己本地倉庫裡沒有這個檔案,於是用這個命令合併

分析:引起該錯誤的原因是,目錄中沒有檔案,空目錄不能提交。

依次執行:

git pull origin master

git push origin master12

目前這些,以後出現再增加。

附一張圖

git 上傳本地檔案

1 在本地新建乙個資料夾 2 進入資料夾 3 右鍵 git bash here 然後將github上面的倉庫轉殖到本地。git clone 倉庫位址 4 完成之後,本地新建的資料夾下面就會多出個資料夾。該資料夾名即為你github上面新建的那個repository 的名字。5 把要上傳的資料夾裡面的...

git 上傳本地檔案到github

git 上傳本地檔案到github 1 git config global user.name your real name 2 git config global user.email you email.address git init git add git commit m test git...

git 上傳本地檔案到github

git 上傳本地檔案到github 1 git config global user.name your real name 2 git config global user.email you email.address git init git add git commit m test git...