2017年2月11日 星期六

How to upload files to Github repository by TortoiseGit? 如何上傳專案到GitHub


實驗時間 Time: 2017-02-11

Step 1 : Apply for a GitHub account.
Step 1-2 : Build up a Repository for this test 建立一個專案庫

Step 2 : Download  and Install Git  https://git-scm.com/ 

Step 3 : Download  and Install TortoiseGit   https://tortoisegit.org/

Step 4 : 選擇要上傳的資料夾,滑鼠右鍵。選Git Commit將檔案Commit到 Git裡面,等下要透過Git上傳到GitHub(使用 push 指令)



如果直接push  會出現以下錯誤訊息  
附註: 必須使用Git Command line或是 Git Sync... 介面才看得到

This repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting .git/hooks/pre-push.

因此安裝以下的東西就可以了。

Step 5 : Download  and Install Git LFS   https://git-lfs.github.com/
Step 6 : push剛剛commit到 Git的內容,就可以看到成功上傳到GitHub自己的專案了。

附註:過程中需要輸入 GitHub的帳號密碼,因此需要事先申請。
附註:使用TortoiseGit  push的時候需要設定 GitHub 專案的url
            選擇下圖的Destination中的Manage 去設定Git的remote內容


下圖:  滑鼠右鍵,進入Git Commit 新的檔案要先 Add 才能用 TortoiseGit   Commit到  Git 裡面喔~



附註:如果修改資料後要上傳....
            首先 滑鼠右鍵  ==> Git Commit
            然後,滑鼠右鍵 ==> Git Sync.. ==> 要先 pull 然後再 push 才會成功。

參考 Reference
https://github.com/git-lfs/git-lfs/issues/853

沒有留言:

張貼留言