文章目录
  • Login the github and click the “Fork” button.

    It’s quite simple, just clicks a button.

  • Clone your fork

    Make sure it’s your fork. For example, I had forked the project nburrus/rgbdemo,and now my own fork is leezhm/rgbdemo.So you can clone your fork.

    # Clone your fork
    $ git clone https://github.com/leezhm/rgbdemo.git
    
  • Configurate remotes

    If you want to sync your fork with its origin master repo,you should add another remote called upstream

    # Change the active directory
    $ cd rgbdemo
    
    # Add the upstream url    
    $ git remote add upstream https://github.com/nburrus/rgbdemo.git
    
    # Keeping update with the upstream and merges any changes fetched 
    # into your working files
    $ git fetch upstream
    $ git merge upstream/master
    
  • Nowadays,you can push/pull your own code to your fork, and sync with origin repo.

文章目录