Allow pushing branches to forks

Open
#125 1 comment 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
git, github, go
Domain
cli, devtools

Research direction

Start with the README sections describing --repo, branch creation, pushing, and pull-request creation, then trace the CLI handling for those options. Determine how a separate --push-repo would affect both the push target and the parent repository for the pull request. Done means the documented command can push the branch to the fork while opening the PR against the parent repository.

Written by the indexing model from the issue text.

Description

enhancement

Describe the solution you'd like
I contribute to various repositories where the development model involves forking a repo, pushing to the fork, and then making a PR back to the parent repo. In this situation my forked repo's main branch is rarely up-to-date because the local main branch is pointing to the parent repo's version of the branch, i.e. locally I have main -> upstream/main and origin/main lags arbitrarily far behind upstream/main. In those scenarios, I would like to be able to point git-xargs to push my new branch to a different repo than the repository from which it was cloned. I envision something like:

git-xargs \
  --branch-name test-branch \
  --repo parent/repo \
  --push-repo forked/repo \
  --commit-message "Create hello-world.txt" \
  touch hello-world.txt

Apologies in advance if there's a way to do this that I'm missing! I've read through the README and glanced through issues, and don't see anything similar discussed anywhere.

Describe alternatives you've considered
Keeping the main branch on my forks would partially address this problem by ensuring that I am making changes from the same state as the parent repo. However, you would still need a way for the created PRs to point back to the parent repo rather than the main branch on the fork, which IIUC requires some additional information no matter what.

Additional context
None

Dominant language
Go
Stars
1.1k
Forks
75
Avg merge
22h 5m
Merged PRs (30d)
4

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from gruntwork-io/git-xargs

All issues in gruntwork-io/git-xargs

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.