• slider image 221
:::

4-1 基礎

第一次執行

先設定自已的帳號名稱,範例:

git config --global user.name "John Doe"
git config --global user.email johndoe@example.com

 

取得 github 的程式碼

git clone https://github.com/digitalfruit/limejs.git
會在所在目錄下,下載一份完整程式。

 

建立自已的 git 

在該目錄中

建立 README.md 檔案,在其中撰寫專案文件

git init

#增加檔案 (如果有多檔案,重複加入)
git add README.md


#加入說明文字
git commit -m "first commit"


#指定網站上的專案 (要先在 github 網頁中建立,取得專案網址)
git remote add origin https://github.com/prolin99/share.git


#開始上傳,會詢問帳號、密碼
git push -u origin master

 

 #如果失敗,可能遠端已有檔案版本不一致,需要先下載同步一下
git pull -u origin master

 

再次新增檔案

git add index.php
git commit -m "說明文字"
#再次上傳
git push -u origin master

修改後再上傳

vim index.php
git add index.php
git commit -m "  Fix something "
git push -u origin master

 

刪除檔案

git rm  index.php
git commit -m "  Fix something "
git push -u origin master

 

 

這些可以使用很多圖像軟體,簡化以上動作。例 ATOM 編輯器的 github 套件。


Google網站翻譯工具列

站內搜尋