使用git github管理ios專案 個人總結

2021-06-05 18:54:50 字數 1983 閱讀 7812

首先 github上的專案是開源的,別人都可以看到,所以***。。。。

找了幾篇關於github的教程,一步一步照葫蘆畫瓢 下面是兩個自我感覺不錯的教程,其他的都太墨跡了,食之無味:

使用github管理ios分布式專案開發      (比較詳細)

tit /github 使用方法小記:    

說重點:

1.建立乙個新的repository:

先在github上建立並寫好相關名字,描述。

$cd ~/hello-world        //到hello-world目錄

$git init                     //初始化

$git add .                   //把所有檔案加入到索引(不想把所有檔案加入,可以用gitignore或add 具體檔案)

$git commit               //提交到本地倉庫,然後會填寫更新日誌( -m 「更新日誌」也可)

$git remote add origin [email protected]:wadeleng/hello-world.git        //增加到remote

$git push origin master    //push到github上

2.更新專案(新加了檔案):

$cd ~/hello-world

$git add .                  //這樣可以自動判斷新加了哪些檔案,或者手動加入檔案名字

$git commit              //提交到本地倉庫

$git push origin master    //不是新建立的,不用再add 到remote上了

3.更新專案(沒新加檔案,只有刪除或者修改檔案):

$cd ~/hello-world

$git commit -a          //記錄刪除或修改了哪些檔案

$git push origin master  //提交到github

4.忽略一些檔案,比如*.o等:

$cd ~/hello-world

$vim .gitignore     //把檔案型別加入到.gitignore中,儲存

然後就可以git add . 能自動過濾這種檔案

5.clone**到本地:

$git clone [email protected]:wadeleng/hello-world.git

假如本地已經存在了**,而倉庫裡有更新,把更改的合併到本地的專案:

$git fetch origin    //獲取遠端更新

$git merge origin/master //把更新的內容合併到本地分支

6.撤銷

$git reset

7.刪除

$git rm  * // 不是用rm

//------------------------------常見錯誤-----------------------------------

1.$ git remote add origin [email protected]:wadeleng/hello-world.git

解決辦法:$ git remote rm origin

然後在執行:$ git remote add origin [email protected]:wadeleng/hello-world.git 就不會報錯誤了

2. $ git push origin master

解決辦法:$ git pull origin master //先把遠端伺服器github上面的檔案拉先來,再push 上去。

本人遇到的還有乙個錯誤就是,工程傳進github 了可是裡頭缺少檔案,

解決方法 $git add .    (注意一點  。  )表示新增所有檔案,

使用git github管理ios專案 個人總結

首先 github上的專案是開源的,別人都可以看到,所以 找了幾篇關於github的教程,一步一步照葫蘆畫瓢 下面是兩個自我感覺不錯的教程,其他的都太墨跡了,食之無味 使用github管理ios分布式專案開發 比較詳細 tit github 使用方法小記 說重點 1.建立乙個新的repository...

使用git github管理ios專案 個人總結

首先 github上的專案是開源的,別人都可以看到,所以 找了幾篇關於github的教程,一步一步照葫蘆畫瓢 下面是兩個自我感覺不錯的教程,其他的都太墨跡了,食之無味 使用github管理ios分布式專案開發 比較詳細 tit github 使用方法小記 說重點 1.建立乙個新的repository...

Git Github使用教程

一 配置github 1.註冊github賬戶renle177 2.新建 庫linux test 以上操作省略.二 本地操作配置 linux環境 1.安裝git及配置環境 yum y install git git config global user.name renle177 git confi...