完整的上傳項目代碼:
1.cd filename (進入即將上傳文件的目錄)
2.git init (初始化git)
3. $ git config --global user.name "your name"
$ git config --global user.email "[email protected]"
(接下來我們要做的就是把本地倉庫傳到github上去,在此之前還需要設置 username和email,因爲github每次commit都會記錄他們)
4.$ git remote add origin git@github.com:soulfeng/sshd_ununtu.git
github.com:這個可以根據使用的github/gitlab改變
soulfeng/sshd_ununtu:使用人/倉庫名稱 這個需要去使用的賬號上去建立
5.$git add . (上傳文件夾下面的文件,也可以通過指定)
6.$git commit (提交,這裏會讓你寫提交說明)
7.$git push origin master (上傳到帳號裏面)
實例1:
實例2: