[HTCondor-devel] fetching pull requests


Date: Tue, 12 Sep 2017 16:26:32 -0500 (CDT)
From: Carl Edquist <edquist@xxxxxxxxxxx>
Subject: [HTCondor-devel] fetching pull requests
Hey guys,

I was talking to Zach and Tim T about this, apparently it might be of general interest for anyone interested in fetching / examining / merging github pull requests in your local git repo.

A simple recipe:

	 $ git remote add github https://github.com/htcondor/htcondor
	 $ git config --add remote.github.fetch '+refs/pull/*:refs/pull/*'

adds the following to your .git/config:

	 [remote "github"]
		 url = https://github.com/htcondor/htcondor
		 fetch = +refs/heads/*:refs/remotes/github/*
		 fetch = +refs/pull/*:refs/pull/*

Then:

	$ git fetch github

Will pull in a bunch of stuff under:

	 refs/pull/NN/head   # the tip commit of their PR
	 refs/pull/NN/merge  # github's automaticly generated merge commit


So, if you wanted to manually merge PR #16 into somebranch, you could do:

	 $ git checkout somebranch
	 $ git merge pull/16/head


... If you don't want the new github remote to pull in all the regular branches too (that is, if you only want the PR refs), just omit the "--add" option in the "git config" command, or remove the "fetch = +refs/heads/*:refs/remotes/github/*" line from the .git/config file.


Zach may also have further comments on his milage with this.


gl;hf,

Carl

[← Prev in Thread] Current Thread [Next in Thread→]
  • [HTCondor-devel] fetching pull requests, Carl Edquist <=