前提是你已经有了自己的github账号,并且已经关联了本地和远程的仓库,设置好了ssh密钥。自行百度解决。
上传的主要命令:
git init git add . git commit -m "备注的信息" //关联到远程的仓库 git remote add origin https://github.com/Alanrah/WebGL-.git //上传到远程仓库 git push origin master
这是我的上传大致的过程,有兴趣可以看看。
// MyHtmlCss是我要上传的文件的目录,目录下是要上传的文件 Catherine@DESKTOP-GP6IPQS MINGW64 /d/FronteEnd/FrontEndSrc/MyHtmlCss (master) $ git init Initialized existing Git repository in D:/FronteEnd/FrontEndSrc/MyHtmlCss/.git/ Catherine@DESKTOP-GP6IPQS MINGW64 /d/FronteEnd/FrontEndSrc/MyHtmlCss (master) $ git add .(注意,add后面是空格和点号) Catherine@DESKTOP-GP6IPQS MINGW64 /d/FronteEnd/FrontEndSrc/MyHtmlCss (master) $ git remote add origin https://github.com/Alanrah/MyHtmlCSS.git Catherine@DESKTOP-GP6IPQS MINGW64 /d/FronteEnd/FrontEndSrc/MyHtmlCss (master) $ git commit -m "my first commit myhtmlcss"(引号内为本次上传的信息) [master (root-commit) 2dd1125] my first commit myhtmlcss 60 files changed, 4618 insertions(+) create mode 100644 "CSS3-345270246350203214346231257345210207346215242347231273351231206346263250345206214350241250345215225/css/style.css" …… create mode 100644 "346226207346234254345212240345257206.html" create mode 100644 "347273277350217212.html" create mode 100644 "351227252347203201350255246347244272347201257.htm" Catherine@DESKTOP-GP6IPQS MINGW64 /d/FronteEnd/FrontEndSrc/MyHtmlCss (master) $ git push origin master Counting objects: 82, done. Delta compression using up to 4 threads. Compressing objects: 100% (74/74), done. Writing objects: 100% (82/82), 621.91 KiB | 0 bytes/s, done. Total 82 (delta 3), reused 0 (delta 0) remote: Resolving deltas: 100% (3/3), done. To https://github.com/Alanrah/MyHtmlCSS.git * [new branch] master -> master Catherine@DESKTOP-GP6IPQS MINGW64 /d/FronteEnd/FrontEndSrc/MyHtmlCss (master) $ //ok,到这里该仓库上传完毕 //现在以同样的方法上传仓库: Catherine@DESKTOP-GP6IPQS MINGW64 /d/FronteEnd/WebGL/webGL中文网站基础教程学习 $ git init Initialized empty Git repository in D:/FronteEnd/WebGL/webGL中文网站基础教程学习/.git/ Catherine@DESKTOP-GP6IPQS MINGW64 /d/FronteEnd/WebGL/webGL中文网站基础教程学习 (master) $ git add . warning: LF will be replaced by CRLF in js/d3.js. The file will have its original line endings in your working directory. The file will have its original line endings in your working directory. …… warning: LF will be replaced by CRLF in src/lesson15/index.html. The file will have its original line endings in your working directory. Catherine@DESKTOP-GP6IPQS MINGW64 /d/FronteEnd/WebGL/webGL中文网站基础教程学习 (master) $ git commit -m "WebGL中文教程代码" [master (root-commit) 858abfa] WebGL中文教程代码 69 files changed, 140515 insertions(+) create mode 100644 js/d3.js create mode 100644 js/three.min.js …… create mode 100644 src/nehe.gif create mode 100644 "three.js347232204350207252345255246345237272347241200.doc" Catherine@DESKTOP-GP6IPQS MINGW64 /d/FronteEnd/WebGL/webGL中文网站基础教程学习 (master) $ git remote add origin https://github.com/Alanrah/WebGL-.git Catherine@DESKTOP-GP6IPQS MINGW64 /d/FronteEnd/WebGL/webGL中文网站基础教程学习 (master) $ git push origin master Counting objects: 74, done. Delta compression using up to 4 threads. Compressing objects: 100% (71/71), done. Writing objects: 100% (74/74), 5.31 MiB | 145.00 KiB/s, done. Total 74 (delta 13), reused 0 (delta 0) remote: Resolving deltas: 100% (13/13), done. To https://github.com/Alanrah/WebGL-.git * [new branch] master -> master Catherine@DESKTOP-GP6IPQS MINGW64 /d/FronteEnd/WebGL/webGL中文网站基础教程学习 (master) $