提交代碼到github

1. 下載gitgit

點擊download下載便可。下載地址:https://gitforwindows.org/github

2. 註冊githubwindows

github地址:https://github.com/ui

必定要記得註冊的用戶名,郵箱和密碼。之後登陸github,以及提交代碼都會用到。code

3. 初始化本地git倉庫blog

新建一個目錄(名字本身隨便取)-------》進入目錄-------》鼠標右鍵-------》在出現的菜單中,選擇 Git Bash Here -------》進入git命令界面-------》執行git init命令rem

4. 建立文件,提交到本地倉庫it

cuishuai01@SXS-A333-D MINGW64 /e/githubcode/oodb (master)
$ touch README                      #建立文件io

cuishuai01@SXS-A333-D MINGW64 /e/githubcode/oodb (master)
$ git add README                      #把文件添加到本地ast

cuishuai01@SXS-A333-D MINGW64 /e/githubcode/oodb (master)
$ git commit -m "first commit"                  #提交到本地倉庫
[master (root-commit) d89af61] first commit
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 README

cuishuai01@SXS-A333-D MINGW64 /e/githubcode/oodb (master)
$ git push -u origin master                    #push到遠程分支
fatal: HttpRequestException encountered.
An error occurred while sending the request.
Username for 'https://github.com': cs-Hacker            #在這裏要輸入用戶名(當時註冊github的時候的用戶名),輸入以後按下回車,會提示輸入密碼,輸入密碼正確以後,就會push到遠程的github分支了Counting objects: 6, done.Delta compression using up to 4 threads.Compressing objects: 100% (3/3), done.Writing objects: 100% (6/6), 465 bytes | 465.00 KiB/s, done.Total 6 (delta 0), reused 0 (delta 0)To https://github.com/cs-Hacker/oodb.git * [new branch] master -> masterBranch 'master' set up to track remote branch 'master' from 'origin'.

相關文章
相關標籤/搜索