2015年4月9日 星期四

[Git] 如何把已存在的 project 上傳到 Github

主要是參考這一篇Github官網的教學:

Adding an existing project to GitHub using the command line


1. 先在Github上創建一個新的 repository
2. 接著打開Git Bash,cd到那個project所在的資料夾
3. 輸入"git init",把它initial 成一個 Git repository
4. 輸入"git add .",將所有的檔案都變成 first commit
5. 輸入"git commit -m 'First commit' ",Commit the files
6. 去Github那邊,把repository的網址(URL)複製起來
Copy remote repository URL field
7. 輸入"git remote add origin URL",設定新的URL
8. 輸入"git remote -v",確認URL
9. 輸入"git push origin master",並輸入 Username 和 Password

接著到Github上的repository看,就可以發現你的project被放到Github上囉!


沒有留言:

張貼留言