Skip to content

GitHub Pull Request Creator

This package provides functionality to programmatically create a "Pull Request" on a repository hosted on GitHub.

Setup

Set up your Github settings on Edit/Project Settings/Stratkit/Github Settings: img-1.png

Usage

PullRequestCreatorConfig config = new();
PullRequestCreatorUI prCreatorUi = new();
prCreatorUi.SetConfig(config);
prCreatorUi.OpenWindow();

Installation

This package depends on git command line tool. Make sure you have git and, if required, git-lfs installed. Use git credential manager to avoid having to enter your credentials every time.

MacOS

Use homebrew to install git and git-lfs

brew install git git-lfs
git config --global credential.helper osxkeychain
sudo git lfs install --system

Windows

Download and install git from https://git-scm.com/download/win Download and install git lfs from https://git-lfs.github.com/

Enable caching of git credentials:

git config --global credential.helper manager

You should not use the Open SSH client that comes with Git for Windows. Instead, Windows 10 has its own implementation of Open SSH that is integrated with the system. To achieve this:

  1. Start the ssh-agent from Windows Services:
  2. Type Services in the Start Menu or Win+R and then type services.msc to launch the Services window;
  3. Find the OpenSSH Authentication Agent in the list and double click on it;
  4. In the OpenSSH Authentication Agent Properties window that appears, choose Automatic from the Startup type: dropdown and click Start from Service status:. Make sure it now says Service status: Running.

  5. Configure Git to use the Windows 10 implementation of OpenSSH by issuing the following command in Powershell:

    git config --global core.sshCommand C:/Windows/System32/OpenSSH/ssh.exe
    

  6. Configure SSH to automatically add the keys to the agent on startup by editing the config file found at $HOME\.ssh\config (full path - C:\Users\%YOUR_USERNAME%\.ssh\config), and add the following lines:

    Host *
        AddKeysToAgent yes
        IdentitiesOnly yes
    
    You can also add the following lines if you generated an SSH key with custom name or multiple SSH keys:
    Host github.com
        HostName github.com
        User your_user_name
        IdentityFile ~/.ssh/your_file_name
    

  7. Add your SSH key to the ssh-agent by issuing the ssh-add command and entering your passphrase:

    ssh-add $HOME/.ssh/your_file_name
    

  8. Done! Now restart your Powershell and even Windows if necessary.

Source https://gist.github.com/danieldogeanu/16c61e9b80345c5837b9e5045a701c99. Cheers!