【黑馬Android】(12)版本控制SVN&GIT

來源:互聯網
上載者:User

標籤:

subversion服務端和用戶端安裝

VisualSVN-Server-2.7.3.msi

TortoiseSVN-1.6.6.17493-win32-svn-1.6.6.msi

TortoiseSVN基本操作和衝突示範



eclipse外掛程式示範

eclipse_svn_site-1.6.5.zip


使用svn案例示範

某研發團隊2011年初開發了一款名為Apollo的資訊系統,目前發行v1.0版本。此項目初期已有部分基礎代碼,研發團隊再此基礎代碼上經過3個月的努力發布了一個功能相對完備的Apollo 1.0版本進行銷售。

 

由於銷售業績良好,因此研發團隊正在著手v2.0版本的開發工作。

但就在這個時候,有客戶發現v1.0軟體系統一嚴重bug,如不及時修複將造成嚴重後果。

 

研發團隊收到bug報告後立刻安排部分研發人員對v1.0版本進行修複,但其他研發人員則繼續開發v2.0版本的新功能。

修複bug的研發人員很快紮到問題原因並對問題代碼進行了修複,很快發布了v1.1版本發給了客戶,因此沒有造成重大損失。

 

Bug修複後研發人員將修複後的代碼整合到研發主線中來,這樣就可以保證今後發布的後續版本不會再出現此問題。

就這樣研發團隊在大家的共同努力下工作有條不紊的進行著

使用svn管理android工程

Git簡介和倉庫建立

Git-1.7.9-preview20120201.exe 安裝包


Git常用命令示範

1. 建立git資產庫

git init --bare 庫名稱

2. 在使用者檔案夾下把資源clone下來

git clone <倉庫目錄> /g/software/repository/git/itheima <使用者目錄> .

注意:clone時候使用者目錄必須為空白

 

3. 建立一個檔案,納入到版本控制中。

git add <檔案名稱>

第一次執行會出警告:warning: LF will be replaced by CRLF in readme.txt.

The file will have its original line endings in your working directory.

警告處理:需要配置使用者資訊

git config user.name = "zhangsan"

git config user.email = "[email protected]"

4. 提交到本地版本庫裡。

git commit <檔案名稱>

5. 推送到遠程共用版本庫中

git push origin master

6. 切換使用者,拉取最新的檔案

git pull

TortoiseGit衝突和補丁示範

TortoiseGit-1.7.7.0-32bit.msi 安裝包


git pull 之後有衝突:

 

$ git pull

remote: Counting objects: 5, done.

remote: Compressing objects: 100% (2/2), done.

remote: Total 3 (delta 0), reused 0 (delta 0)

Unpacking objects: 100% (3/3), done.

From g:/software/repository/git/itheima26

   50db030..a04027a  master     -> origin/master

Auto-merging readme.txt

CONFLICT (content): Merge conflict in readme.txt

Automatic merge failed; fix conflicts and then commit the result.

 

 

解決方案:

1.git mergetool

調用上面命令之後會提示你輸入編輯方法,輸入:beyond compare進入編輯器.

 

2.編輯完之後.調用git commit -a把目前的目錄中所有都提交到本地庫中.

 

3.git push origin master 提交到遠程庫中.

使用git示範案例

【黑馬Android】(12)版本控制SVN&GIT

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.