Hi, I’m Dung Huynh Duc . Nice to meet you.

About Me

I’m a full stack developer. I’m a fast learner and self-taught coder. I often take my time for researching and learning about hot and trending technology.

github
git
hub

#TIL 42 - Cherry pick from pull request

blog_hero_#TIL 42 - Cherry pick from pull request

How to cherry pick from pull request

Installation

Use Homebrew to install hub on macOS:

  brew install hub

Configuration

After installing, configure hub to work with GitHub by editing the ~/.config/hub file.

  1. Create or Edit the Configuration File:

    vi ~/.config/hub  # You can use any text editor
    
  2. Add Your Configuration:

    github.com:
        - user: YOUR_USERNAME
          oauth_token: ghp_YOUR_TOKEN
          protocol: https
    
  3. Save and Exit the text editor.

Cherry pick from pull request

Use hub am Command: To apply the changes from a specific GitHub pull request to your local branch, use the following command:

  hub am -3 GITHUB-URL

Here, -3 is recommended for three-way merging and GITHUB-URL is the URL of the pull request or commit you want to apply.

This will download the pull request's patch to a temporary location and then use git am to apply it to your local branch.

Hope this provides a concise and informative explanation.