git & x codepptx
TRANSCRIPT
http://techmaster.vn
Git & XCode
Nguyen Thanh Dat
http://techmaster.vn
Add .gitignore
Copy file .gitignore vào thư mục gốc của project
http://techmaster.vn
Terminal
Open terminal ,cd tới thư mục gốc của project và đánh lệnh sau
git initgit add .git commit –m “Commit init”
git remote add origin GIT_URL
git push origin master
Check lại source code trên website
http://techmaster.vn
Push, Commit, Pull on XCode
http://techmaster.vn
Versions
Giúp cho việc theo dõi và so sánh sự thay đổi giữa các lần commit với nhau.
http://techmaster.vn
Branch
Open organizer window (Window->Organizer), click vao tab Repository
http://techmaster.vn
Branch
Branch là 1 nhánh các commit.Ví dụ: trước khi thực hiện việc thay đổi UI cho iPhone. Add new branch iPhoneUI và switch sang branch này
Nếu muốn back lại các thay đổi, thì switch về branch trước đó.
http://techmaster.vn
Switch branch
http://techmaster.vn
Merge branch
• Ví dụ có 2 nhánh: Master và iPhoneUI
• Để merge các thay đổi trên iPhoneUI vào nhánh master. Thì switch tới nhánh master và chọn merge (File/source control/merge)
• Xcode sẽ hiện thị ra 1 combo box chọn iPhoneUI. Tiếp theo xác nhận lại những đoạn code muốn thay đổi