1.ssh-keygen -t rsa -C 843409677@qq.com
2.會在本地C:\Users\你的用戶名.ssh生成文件夾,里面有id_rsa和id_rsa.pub兩個文件
然后復制id_rsa.pub文件里面的內容,到https://github.com/settings/keys新建一個,
3.在項目文件夾中 用git bash here 輸入 git init命令,使項目文件夾加入git管理;
還需要新建一個文件 README.md github官方要求提交項目得有這個文件。
4.輸入 git add .(不要漏了“.”),將Test文件夾全部內容添加到git。
如果報了文件格式的錯誤,輸入 git config --global core.autocrlf false
5.輸入 git commit -m "first commit"
6.輸入 git remote add origin https://github.com/shench5612390/Test.git(git remote add origin 你自己的https地址),連接你的guthub倉庫。
7.輸入 git push -u origin master,上傳項目到Github。這里會要求輸入Github的賬號密碼,按要求輸入就可以。
8.需要輸入用戶名和郵箱,配置一下再次提交就可以了。
git config user.name “用戶名”
git config user.email 郵箱地址
9.刪除遠程的文件
git rm 文件名
git commit -m "for test"
git push