How to Co-work wither parter via GitHub.
GitHub Collaborative Development Scenario simulation
GitHub not only has a lot of open source projects to reference, it is also the best tool for collaborative development, and then simulates the process of collaborative development.
Project Initiator: Koffuxu
One of the project contributors: Xugangfeng
1,koffuxu launched a project and then posted it on GitHub, inviting Xugangfeng to collaborate on the development
1.1 New Repository on GitHub
1.2 Under Koffuxu's server clone this repository, and then add their initial content to this warehouse
| 1 |
git clone https://github.com/koffuxu/Embedded_Android_in_Chinese.git |
1.3 Push your base project to GitHub
| 1 |
Git push-u Origin Master |
2,xugangfeng received the invitation to develop collaborative development of this project, first of all to build a development directory
2.1 Enter Koffuxu's GitHub project address (https://github.com/koffuxu/Embedded_Android_in_Chinese.git), First fork this project into your own (Xugangfeng) project
2.2. Clone the fork to Xugangfeng's local
| 1 |
git clone https://github.com/xugangfeng/Embedded_Android_in_Chinese.git |
2.3 New and switch to work (DEV) branch
| 1 |
Git Brach Dev |
| 2 |
git checkout Dev |
2.4 Add the Koffuxu project to the Xugangfeng remote repository
| 1 |
Git remote add upstream Https://github.com/koffuxu/Embedded_Android_in_Chinese |
2.5 Take Koffuxu's branch down.
2.6 Update the Maser branch of Koffuxu to local
2.7 Merging Koffuxu branches to local (in fact not needed for the first time)
| 1 |
Git rebase upstream/master |
3,xugangfeng implemented a feature, and now he's going to start submitting this commit.
3.1 Of course this is the normal code submission, the approximate process is as follows
| 1 |
git add test.md |
| 2 |
git commit-m "modify from Xugangfeng" |
| 3 |
Git push-u Origin Dev |
3.2 This time, Xugangfeng into the GitHub webpage, enter compare & pull request, fill in some information, Crete pull request.
4,koffuxu then merge the Xugangfeng submission into the master branch
4.1 In the GitHub Koffux project, you can see a pull request hint and then comfirm merge to
4.2 Next go to Koffuxu's local, execute git pull to see if it has been updated.
5, there is a scene, is Koffuxu update, Xugangfeng need to update the merge
5.1 Koffuxu added a new one in c4.md
5.2 Contributor Xugangfeng, it needs to be merged in the original basically update.
| 1 |
git remote update upstream |
5.3 Xugangfeng start to merge updates
| 1 |
Git rebase upstream/master |
5.4 git log view, has been merged
The whole process is more verbose, take a slow look. There are questions that can be raised.
How to co-develop on GitHub