做MMORPG 專案時, 這個VCS搞亂 會是大災難.
- 讀這篇文章: 關於版本控制
集中式, 分散式,
PM 對版本,對更新要很清楚的邏輯和次序. 一個案子版本若清清楚楚, 其他海外版本其實就是複製, 不會有大改變. 但如果一開始版本內容交代不太清楚, 不太清楚跟新什麼? 什麼先什麼後? 後面就亂了.
這已是我的回憶了. 當版本清清楚楚 工作其實是有點無聊了, 都搞定了.
版本控制也是一種軟體工程技巧,藉此能在軟體開發的過程中,確保由不同人所編輯的同一程式檔案都得到同步
我最近開始用git hub, 把Git善用好, 對版本控制及專案管理有助益.
- 版本控制
一個版本控制系統 Version Control System (VCS),通常有以下功能
- 建立 Repository,用來保存程式碼。
- 方便散佈程式給團隊,有效率協同開發
- 記錄誰改變什麼、在什麼時候、因為什麼原因
- Branch(分支),可因不同情境分開開發
- Tag(標籤) 重要里程碑,以便參照
那麼,什麼東西要存進 Repository 呢?
簡單來說,就是所有跑起來這個專案需要的東西,包括所有原始碼、範例設計檔、文件等等。而像是暫存檔、log 檔案、build files 等編譯後的產物則不需要存進 Repository
- Github
是一個 git 的托管網站,可以讓開發者將自己的專案儲存到網路上,與全世界分享,我們可以方便的使用 Git 在本機進行專案管理。
GitHub 同時提供付費帳號和為了開放原始碼程式提供的免費帳號
它提供了如 feeds、followers 和顯示開發者們如何在他們版本庫上的版本工作的圖表
- Create A Repo 創建一個知識庫
To put your project up on GitHub, you’ll need a repository for it to live in. Let’s create one!
On GitHub, you can store all kinds of projects in repositories.
Create a new repository on GitHub
- In the upper-right corner of any page, click , and then click New repository.
- Create a short, memorable name for your repository. For example, “hello-world".
- Optionally, add a description of your repository. For example, “My first repository on GitHub."
- Choose between creating a public or private repository.
- Public repositories are a great choice for getting started! They’re visible to any user on GitHub, so you can benefit from a collaborative community.
- Private repositories require a little more setup. They’re only available to you, the repository owner, as well as any collaborators you choose to share with. Private repositories are only available for paid accounts.
- Select Initialize this repository with a README.
- Click Create repository.
Congratulations! You’ve successfully created your first repository, and initialized it with a README file.
Commit your first change
A commit is like a snapshot of all the files in your project at a particular point in time.
When you created your new repository, you initialized it with a README file.
Let’s commit a change to the README file.
- In your repository’s list of files, click README.md.
- Above the file’s content, click .
- On the Edit file tab , type some information about yourself.
- Above the new content, click Preview changes.
- Review the changes you made to the file. You’ll see the new content in green.
- At the bottom of the page, under “Commit changes," type a short, meaningfulcommit message that describes the change you made to the file.
- Click Commit changes.
GitHub: 也提供類似剪貼簿的功能,issue tracker 和網頁使用 Wiki,通過一個 git repository 即可對這些頁面進行編輯
- Git 基本結構
任何檔案在 Git 内都有三種狀態:
- 已提交(committed): 表示該檔案已經被安全地保存在本地 repository 中了。
- 已修改(modified): 修改了某個檔案,但還没有提交保存。
- 已暫存(staged): 把已修改的檔案放在下次提交时要保存的清單中
而在 Git 之中檔案會在三種不同的工作區中轉移,下面分別介紹三種不同工具區
- Working Directory: 所有的修改、變動都發生在這個階段。
- Staging area: 作為一個中繼的工作區,在將檔案放入資料庫之前做確認及檢查的工作區,確認無誤後就可以將檔案轉移至資料庫。
- Repository: 資料庫,儲存著更新的 commit,而線上資料庫會和本機的這個區域進行同步