跳到主要內容

發表文章

目前顯示的是有「github」標籤的文章

How to maintain your project source code in GitHub with collaborative development?

一個人的江湖很孤獨 一個人的江湖是孤獨的,寫程式也是,雖然很多高手都是一個人,但是如果能集合多人的力量不是更好嗎?高手難求,但是一個好的團隊卻是可以培養出來的,加入一個好的團隊,大家努力往前爬,不也是一種幸福嗎? 所以,這篇文章就是要說明如何與團隊協同開發系統,協同開發的流程會是怎麼樣子來進行呢? 組織( Organization) 開發團隊或稱為專案團隊,可以視為一個組織,在組織中有許多角色,有專案管理者、程式開發人員.....等,在GitHub中將專案管理者視為專案擁有者(Owner),其他專案開發者(Member),下圖描述說明:組織(organization)名稱為Org X,其中Mark為專案管理者(owner)、Jimmy與Bill都是程式開發人員(member)。 在這個組織中主要維運一個專案(repo_abc),為Jimmy,Bill和Mark共同維護,接下來就以Jimmy觀點來看他怎麼進行維護專案. Step1) 同步 當有需求需要進行程式修改時,先要進行程式碼同步,把OrgX上repo_abc/master最新程式碼抓下來. $ git fetch remote: Enumerating objects: 9, done. remote: Counting objects: 100% (9/9), done. remote: Compressing objects: 100% (4/4), done. remote: Total 5 (delta 2), reused 3 (delta 1), pack-reused 0 Unpacking objects: 100% (5/5), done. From https://github.com/Org_x/repo_abc e795431..d4468d5 master -> origin/master Step2) 同步再上傳 當完成修改準備要push程式碼到Jimmy的GitHub/repo_abc時,記得先再同步一次,確定沒問題再push. $ git add . $ git commit -m "mark PENDING: Not yet implemented...

解決git push錯誤︰failed to push some refs to git

$ git push -u origin master To https://github.com/shawnkaku/postit.git ! [rejected] master -> master (non-fast-forward) error: failed to push some refs to 'https://github.com/shawnkaku/postit.git' hint: Updates were rejected because the tip of your current branch is behind hint: its remote counterpart. Integrate the remote changes (e.g. hint: 'git pull ...') before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details. $ git pull --rebase origin master From https://github.com/shawnkaku/postit  * branch            master     -> FETCH_HEAD First, rewinding head to replay your work on top of it... Applying: init $ git push origin master Counting objects: 65, done. Delta compression using up to 4 threads. Compressing objects: 100% (55/55), done. Writing objects: 100% (65/65), 15.23 KiB | 2.54 MiB/s, done. Total 65 (delta 2), reused 0 (delta 0) remote: Resolving deltas: 100...