- Generate a GitHub Access Token with
repo:status
access. - Put
gitpr.py
in a scripts directory (I use~/scripts/python/
) and update it with your github access token. - Save
gitpr
as/usr/bin/gitpr
and make it executable (chmod +x /usr/bin/gitpr
). Then update the value ofscripts_dir
to the directory you savedgitpr.py
in. - Optional: Install pyperclip with
sudo pip install pyperclip
. If pyperclip is detected, the link to the Pull Request on GitHub will be copied to your clipboard. - Optional: if you are using a repository that takes Pull Requests at a branch other than master, you will have to add the repository to the
target_branches
dict with the repo as the key and the target branch as the value. See the code for an example.
- Fork a repository on GitHub
git clone
your forkcd
to cloned repo directorygit remote add
the original repository- Make changes and commit
- Run
gitpr
It will push your changes to your fork, then submit a pull request from your fork to the original repository.
ex. Fork https://github.com/atom/atom
git clone [email protected]:Cabloo/atom.git
cd atom
git remote add original_repo [email protected]:atom/atom.git
touch testfile.txt
git add testfile.txt
git commit -m 'This will be the commit message and the title of the pull request'
gitpr
Setup:
repo:status
access.gitpr.py
in a scripts directory (I use~/scripts/python/
) and update it with your github access token.gitpr
as/usr/bin/gitpr
and make it executable (chmod +x /usr/bin/gitpr
). Then update the value ofscripts_dir
to the directory you savedgitpr.py
in.sudo pip install pyperclip
. If pyperclip is detected, the link to the Pull Request on GitHub will be copied to your clipboard.target_branches
dict with the repo as the key and the target branch as the value. See the code for an example.Usage:
git clone
your forkcd
to cloned repo directorygit remote add
the original repositorygitpr
It will push your changes to your fork, then submit a pull request from your fork to the original repository.
ex. Fork https://github.com/atom/atom