1. 程式人生 > >怎麽在github上上傳項目?

怎麽在github上上傳項目?

-s star git push 創建倉庫 code load 錯誤 終端 objective

1.首先創建一個github賬號

2.創建倉庫,將倉庫clone到本地

3.在本地添加項目,上傳到github中

4.在github中設置訪問權限

ed:1.如果是window版本通過https://git-scm.com/downloads下載,如果下載不下來通過F12查看下載地址,通過迅雷或者其他的軟件進行下載。

  2.通過git clone 自己倉庫的網站地址,不能在桌面直接創建,需要創建個文件夾,下載後進入github.io進行添加項目

  3.git add 文件名 或者 git add . 添加所有

  4.git commit -m "添加註釋"

  5.git push -u origin master推到github中

  6.如果添加出現下面錯誤

* Please tell me who you are. Run git config --global user.email "[email protected]" git config --global user.name "Your Name" to set your account‘s default identity. Omit --global to set the identity only in this repository. fatal: empty ident name (for (null)>) not allowed during executing git -c core.quotepath=false commit -m "Initial commit" --

  解決方式:在git bash終端中添加下面兩行代碼

  1. git config --global user.email "[email protected]"
  2. git config --global user.name "Your Name"

  上面的方法配置的是全局的用戶名和郵箱!就是說如果沒有單獨為項目配置,那提交的所有項目全部都是這個名字和郵箱!

  

  單獨為項目配置的方法(全局和單獨配置都存在的時候會默認使用項目單獨配置的):

  1.打開項目所在目錄,找到隱藏的.git文件夾。註意這個文件夾是隱藏的,顯示隱藏出來就行。

  2.打開文件夾裏的config文件,推薦用nodepad++打開。

  3.添加這三行到文件:

  [user]
      name = XXX(自己的名稱)
      email = XXXX(郵箱)

  當然也可以通過命令行的方式,只需要在 .git 文件夾下。 例如執行如下命令:

  git  config  user.name  "xxxxx"

5.在setting中進行更改
技術分享
更改後,再次查看此處有網址打開是index.html可以更改後面的路徑。

怎麽在github上上傳項目?