#443 RFE: checkout pull requests locally
Closed: Fixed 6 years ago Opened 8 years ago by pbabinca.

I'd like to use following workflow which I use for GitHub hosted projects:

  1. Clone main project.
  2. Fetch specific pull request and create local branch for that (see 5th point https://help.github.com/articles/checking-out-pull-requests-locally/)
  3. Merge this branch again developement/master branch.
  4. Test changes
  5. If changes are ok merge them via git push/web.

I'd like to have point 2 implemented in Pagure. Currently I don't care about git push in point 5.

Note: implementation of /refs/pull/ like on GitHub is good idea as it follows git's ability to add this remote namespace in local config and even all pull requests can be fetched automatically. Like this: http://stackoverflow.com/a/17644298


I've been doing this with pull requests already. E.g.

% git fetch https://pagure.io/forks/USER/PKG.git branch:localbranch

I have also added this alias in my .gitconfig:


pgfollow = "!f() { base=git config --get remote.origin.url | sed -e 's#.*/##'; git remote add $1 https://pagure.io/forks/$1/$base; }; f"

@mikem but you need to know the $1 in your case.

I definitely vote for this issue.

Or maybe the pagure CLI tool could help here: to at least point to branches of all PRs, something like:

$ pag pull-requests
ID   TITLE   ...
1     Fix bug...
$ pag checkout pr/1

Yeah, I agree this is a case where a cli tool might be the answer. I have wished for this numerous times. Would be nice if I could do most everything on the command line.

So, the ref name will be refs/pull/NNN?

Any idea when this might get deployed?

Soonish, it will be part of the 3.0 release which contains quite some things for pagure over dist-git and we want to test this soon.

The ref is refs/pull/<id>/head which is basically what github does as well.

Login to comment on this ticket.

Metadata