mirror of
https://github.com/jbranchaud/til
synced 2026-01-02 22:58:01 +00:00
Add Target Another Repo When Creating A PR as a GitHub TIL
This commit is contained in:
@@ -10,7 +10,7 @@ pairing with smart people at Hashrocket.
|
||||
|
||||
For a steady stream of TILs, [sign up for my newsletter](https://crafty-builder-6996.ck.page/e169c61186).
|
||||
|
||||
_1676 TILs and counting..._
|
||||
_1677 TILs and counting..._
|
||||
|
||||
See some of the other learning resources I work on:
|
||||
|
||||
@@ -439,6 +439,7 @@ If you've learned something here, support my efforts writing daily TILs by
|
||||
### GitHub
|
||||
|
||||
- [Open A PR To An Unforked Repo](github/open-a-pr-to-an-unforked-repo.md)
|
||||
- [Target Another Repo When Creating A PR](github/target-another-repo-when-creating-a-pr.md)
|
||||
- [Tell gh What The Default Repo Is](github/tell-gh-what-the-default-repo-is.md)
|
||||
|
||||
### GitHub Actions
|
||||
|
||||
20
github/target-another-repo-when-creating-a-pr.md
Normal file
20
github/target-another-repo-when-creating-a-pr.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# Target Another Repo When Creating A PR
|
||||
|
||||
I have a [`dotfiles` repo](https://github.com/jbranchaud/dotfiles) that I forked
|
||||
from [`dkarter/dotfiles`](https://github.com/dkarter/dotfiles). I'm adding a
|
||||
bunch of my own customizations on a `main` branch while continually pulling in
|
||||
and merging upstream changes.
|
||||
|
||||
The primary remote according to `gh` is `jbranchaud/dotfiles`. 98% of the time
|
||||
that is what I want. However, I occasionally want to share some changes upstream
|
||||
via a PR. Running `gh pr create` as is will create a PR against my fork. To
|
||||
override this on a one-off basis, I can use the `--repo` flag.
|
||||
|
||||
```bash
|
||||
$ gh pr create --repo dkarter/dotfiles
|
||||
```
|
||||
|
||||
This will create a PR against `dkarter:master` from my branch (e.g.
|
||||
[`jbranchaud:jb/fix-hardcoded-paths`](https://github.com/dkarter/dotfiles/pull/373)).
|
||||
|
||||
See `man gh-pr-create` for more details.
|
||||
Reference in New Issue
Block a user