Background:
The representative of GIT and GitHub as a distributed version control system has become the preferred version Control tool for most developers. Because of its different and SVN centralized version management, so in a slightly different way to work together, let's compare and analyze (here in my DICOM3.0 standard Chinese version of open source books, for example):
Merge others ' GitHub repositories (merge other's Repo on Github): 1. View current status
F:\Gittest\Zssuretest\Dicom-chinese>git status onBranch Masteryour Branch is up-to-date with ' Origin/master '.Nothing toCommit, working directory CLEANF:\Gittest\Zssuretest\Dicom-chinese>Git remote- vOrigin https://github.com/zssure-test/dicom-chinese.git (Fetch)Origin https://github.com/zssure-test/dicom-chinese.git (push)Other [email protected]-test: Zssure-test/dicom-chinese(fetch) Other [email protected]-test: Zssure-test/dicom-chinese(push) Zssure-thu-originHttps//github.com/zssure-thu/dicom-chinese.git (Fetch)Zssure-thu-originHttps//github.com/zssure-thu/dicom-chinese.git (push)F:\Gittest\Zssuretest\Dicom-chinese>git pullalready up-to-date.
2. Add someone else's warehouse
F:\Gittest\Zssuretest\Dicom-chinese>Git remote- vOrigin https://github.com/zssure-test/dicom-chinese.git (Fetch)Origin https://github.com/zssure-test/dicom-chinese.git (push)Other [email protected]-test: Zssure-test/dicom-chinese(fetch) Other [email protected]-test: Zssure-test/dicom-chinese(push) Zssure-thu-originHttps//github.com/zssure-thu/dicom-chinese.git (Fetch)Zssure-thu-originHttps//github.com/zssure-thu/dicom-chinese.git (push)F:\Gittest\Zssuretest\Dicom-chinese>git remote add Kuangbi-mnhwaHttps//github.com/mnhwa/dicom-chinese.gitF:\Gittest\Zssuretest\Dicom-chinese>Git remote- vKuangbi-mnhwaHttps//github.com/mnhwa/dicom-chinese.git (Fetch)Kuangbi-mnhwaHttps//github.com/mnhwa/dicom-chinese.git (push)Origin https://github.com/zssure-test/dicom-chinese.git (Fetch)Origin https://github.com/zssure-test/dicom-chinese.git (push)Other [email protected]-test: Zssure-test/dicom-chinese(fetch) Other [email protected]-test: Zssure-test/dicom-chinese(push) Zssure-thu-originHttps//github.com/zssure-thu/dicom-chinese.git (Fetch)Zssure-thu-originHttps//github.com/zssure-thu/dicom-chinese.git (push)
3. Download other people's warehouses
F:\Gittest\Zssuretest\Dicom-chinese>Git branch- v*Master bb0d864 Merge Branch' master 'of https://github.com/zssure-test/dicom-chineseF:\Gittest\Zssuretest\Dicom-chinese>git fetch KUANGBI-mnhwaRemote:counting objects: -, done.Remote:total -(Delta0), reused0(Delta0), pack-reused -Unpacking objects: -%( -/ -), done.From https://github.com/mnhwa/dicom-chinese * [NewBranch]Master-Kuangbi-mnhwa/master *[NewBranch]PR/1-KUANGBI-MNHWA/PR/1
4. Export someone else's warehouse to a new branch
F:\Gittest\Zssuretest\Dicom-chinese>Git checkout- bPart5-kuangbiKuangbi-mnhwa/masterbranch Part5-kuangbi SetUp toTrack Remote Branch master from KUANGBI-mnhwa.Switched toANewBranch' Part5-kuangbi 'F:\Gittest\Zssuretest\Dicom-chinese>Git branch- vMaster bb0d864 Merge Branch' master 'of https://github.com/zssure-test/dicom-chinese*Part5-kuangbi 7C23aba6.1. 2. 5----6.1. 3
5. Merging others ' warehouses
F:\Gittest\Zssuretest\Dicom-chinese>git checkout masterswitched toBranch' master 'Your Branch is up-to-date with ' Origin/master '.F:\Gittest\Zssuretest\Dicom-chinese>Git branch- v*Master bb0d864 Merge Branch' master 'of https://github.com/zssure-test/dicom-chinesePart5-kuangbi 7C23aba6.1. 2. 5----6.1. 3F:\Gittest\Zssuretest\Dicom-chinese>git merge Part5-kuangbiMerge made byThe' recursive 'Strategy.Figure/part5/ps3. 5_table6.1_1.Jpg|Bin0 -131815 bytes ...T5\357\274\232DataStructures andEncoding.Md" | 353 +++++++++++++++++++++ 2 files changed, 353 insertions (+) Create mode 100644 figure/part 5/ps3.5_table 6.1_1.jpg Create Mode 100644 "Part5\357\274\232DataStructures andEncoding.Md"
6. Submit changes to the GitHub central warehouse
F:\Gittest\Zssuretest\Dicom-chinese>git status onBranch Masteryour Branch is ahead of' Origin/master ' by 5Commits.(Use"Git Push" toPublish yourLocalCommits) Nothing toCommit, working directory CLEANF:\Gittest\Zssuretest\Dicom-chinese>git push originusername for' https://github.com ': Zssure-testPassword for' https://[email protected] ': Counting objects: +, done.Delta compression using up to 8Threads.Compressing objects: -%( the/ the), done.Writing objects: -%( -/ -),123.50KiB| 0 bytes/s, done.Total -(Delta6), reused0(Delta0) toHttps//github.com/zssure-test/dicom-chinese.gitbb0d864..63368D4 Master -Masterf:\Gittest\Zssuretest\Dicom-chinese>
Ask someone to merge their Github repositories (pull requests on Github):
The "GitHub pull Requests", which was previously published in the series blog dicom:dicom Chinese version of open source books, has introduced the steps of using the pull requests provided by GitHub to implement multi-person collaborative editing, which is not described in detail here. For an overview of the operation process, please read the previous blog post for specific examples.
1. Fork others Warehouse
2. Modify your Own warehouse
"zssure-test""[email protected]"git config --local#此处任意修改README.md的内容#查看修改状态#添加所有修改"zssure git bash test"#提交修改到本地仓库#push修改到github
3. Make a merge request using pull requests in GitHub
4. Wait for others to review the merger completed
You can see the process and results of each member merge on the GitHub home page:
Note:
The above mentioned merging other people's warehouses , for their own initiative to merge other people's changes into their own warehouse; ask others to merge their own changes to synchronize their own changes to other people in the group, mainly to increase their own changes to a public warehouse, As the final release library.
Through the above two basic can accomplish multi-person collaboration work, of course, in the specific application process will also encounter rollback , conflict , revocation and other issues, follow-up will continue to give examples in the actual application process.
[Email protected]
Date: 2015-10-10
Copyright NOTICE: This article is zssure original article, reproduced please indicate the source, without permission shall not be reproduced.
DICOM:DICOM3.0 Standard Chinese version open source book editor "GitHub warehouse Merge"