See good open source projects on GitHub to fork into your project. But what if the fork project updates its project to keep it up to date?
After a search to find a method, the following records the process.
Method One: Login to your GitHub account, select the Project fork, click on the upper left corner of the green icon, Mouse put up after the hint: compare, review, create a pull reques.
Method Two: Clone your project to local after fork.
git clone https://github.com/hakits/libpcap.git
$ git remote-voriginhttps://github.com/hakits/libpcap.git (fetch) originhttps://github.com/hakits/libpcap.git (push )
Add the items before the fork to the local remote branch, which is the author's branch:
$ git remote add libpcap https://github.com/the-tcpdump-group/libpcap.git$ git remote-vlibpcaphttps://github.com/ The-tcpdump-group/libpcap.git (FETCH) libpcaphttps://github.com/the-tcpdump-group/libpcap.git (push) originhttps:/ /github.com/hakits/libpcap.git (FETCH) originhttps://github.com/hakits/libpcap.git (push)
Synchronous
Synchronizing the upstream warehouse to your warehouse requires two steps: first you need to pull away from the remote, and then you need to merge the branches you want into your local copy branch.
Pull
Pull from the remote repository will retrieve its branches and their respective commits. They will be stored under the specified points in your local warehouse.
$ git fetch libpcap from HTTPS://GITHUB.COM/THE-TCPDUMP-GROUP/LIBPCAP * [New branch] android-libpcap-0.9.8-LIBP cap/android-libpcap-0.9.8 * [New branch] bare--Libpcap/bare * [New branch] LBL-libpcap/l BL * [New branch] libpcap-1.6-libpcap/libpcap-1.6 * [New branch] libpcap-1.7-libpcap/libpcap-1.7 * [ New branch] Libpcap_0_6-libpcap/libpcap_0_6 * [New branch] libpcap_0_7-libpcap/libpcap_0_7 * [New BR Anch] Libpcap_0_8-libpcap/libpcap_0_8 * [New branch] LIBPCAP_0_8REL1-Libpcap/libpcap_0_8rel1 * [New Branch] Libpcap_0_9-libpcap/libpcap_0_9 * [New branch] libpcap_1.1-libpcap/libpcap_1.1 * [New branch ] libpcap_1.2-libpcap/libpcap_1.2 * [New branch] libpcap_1.3-libpcap/libpcap_1.3 * [New branch] libpcap_1.4-libpcap/libpcap_1.4 * [New branch] libpcap_1.5-libpcap/libpcap_1.5 * [New branch] Libpc AP_1_0-Libpcap/libPCAP_1_0 * [New branch] libpcap_1_0_rel0b-libpcap/libpcap_1_0_rel0b * [New branch] Libpcap_1_4rel0-L IBPCAP/LIBPCAP_1_4REL0 * [New branch] Linux-2-2-packet-Libpcap/linux-2-2-packet * [New branch] Master Libpcap/master * [New Branch] Origin--Libpcap/origin
git branch-av lists local and remote branches
-A View all branches
-V View information for the last commit object in each branch
$ git branch- av* Master 48AACF2 Merge pull request #433 from Msekletar/master remotes/libpcap/android-l ibpcap-0.9.8 91f35ab copy config.h from subdirectory on Android rather than run configure Remotes/libpcap/bare feab221 regenerated Configure with--WITH-LIBNL switch REMOTES/LIBPCAP/LBL 9de7b67 pcap-0.4 rem otes/libpcap/libpcap-1.6 4fec216 Fix Previous change. remotes/libpcap/libpcap-1.7 b846943 Fix Check for <linux/if_bonding.h>. Remotes/libpcap/libpcap_0_6 6c7150d Update the version number. Remotes/libpcap/libpcap_0_7 85aac6d Get ready for Libpcap 0.7.2 remotes/libpcap/libpcap_0_8 fec98c1 C orrected the definition of in_experimental (0xfxxxxxxx is the experimental space) Remotes/libpcap/libpcap_0_8rel1 9 ad5954 spec file for 0.8
Merge
Now that we've pulled up the upstream repository, we're going to merge its changes to our local branch. This will allow the branch to synchronize with the upstream without losing our local changes.
$ git merge libpcap/master already up-to-date.
Push to server:
$ Git push origin master counting Objects:5, done. Delta compression using up to 4 threads.compressing objects:100% (3/3), done. Writing objects:100% (3/3), 289 bytes, done. Total 3 (Delta 2), reused 0 (Delta 0) to [email protected]:hakits/libpcap.git 48aacf2. 9556D05 Master, Master
after a while, you need to synchronize the project. Just git fetch libpcap command the following actions.
Reference: https://help.github.com/articles/syncing-a-fork/
How to update the fork project in GitHub