Strange behavior of GitHub

Geert Janssens geert.gnucash at
Mon Jul 31 12:29:29 EDT 2017


I read the related conversation on IRC today and you raised the concern of creating too many 
remotes in your local repository when applying pull requests from there.

Adding a remote only to apply a pull request is not really necessary and I never do it. Instead I 
pull the branch from the PR directly into my local repo using "git pull". It takes some shuffling of 
the information provided by the PR.

For example, if you get a PR against the gnucash repo with the following message (taken from 
the real PR#163):
0-wiz-0 [1]wants to merge 2 commits into Gnucash:master from 0-wiz-0:master
I would locally run this command (with master being checked out and fully up to date with 
master on
git pull master

If master on has diverged from 0-wiz-0's master branch, this will trigger a 
merge action, otherwise it would be a fast-forward.

Sidenote: I used to rebase non-fast-forward PR's to avoid the merge but have stopped doing so 
for all but the most trivial PRs. By not rebasing github will properly detect the PR to be merged 
after a rebase, one needs to manually close the PR on github. Also a rebase makes it harder for 
the author of the PR to sync his local repo with our primary one after the PR is pulled.

Here is a breakdown of the relevant info in the PR message compared to the git pull command:

[github-user] wants to merge x commits into Gnucash:[target-branch] from [github-user]:
There's an implicit bit of information as well, namely which [repo] the PR is targetting. Obviously 
you should work in a local repo for the same source base as in github. So if the PR is against 
gnucash-docs, you need to do the git-pull in your local gnucash-docs repo. I mention this, 
because you need this bit of information in your git-pull command as well.

So the above translates into
* go to the proper local repo
* check out [target-branch] (master in the example, but can be maint as well for other PR's)
* make sure this branch is up to date with (using 'git pull' without any 
arguments, assuming you don't have local, non-pushed work on your primary branches. You 
don't, right?)
* then formulate the pull from another remote (from the [github-user]'s repo):

git pull[github-user]/[repo] [source-branch]

It's slightly more typing than clicking the fancy button on github, but avoids the need to make 
each new repo in a PR a remote.



PS: final note - this technique can be used to pull from any other repository (online or not) as 
long as the git command can reach the other repository. So the repository URL can be a github 
url (, but equally a url to another online site that hosts repositories, or 
even a file path to another repo on your own PC. For more info search the git help information 
on repo urls.

On woensdag 26 juli 2017 23:28:01 CEST Frank H. Ellenberger wrote:
> Hi all,
> Dmitry watched, that his PRs disappeared from Maint after I merged them
> in Master.
> So, what happened?
> He sent PR 100-104 to github
> I pulled them via
> sequently into maint, after each calling locally:
> (with git checkout maint)
>  git pull
>  make
>  make check
> He watched, they did not appear in
> I run yesterday locally
>  git checkout master
>  git merge maint
>  make
>  make check
>  git push
> The guides in{de|ru}/ were regenerated
> last night, while *.{epub|mobi|pdf} are still from 2017-07-01. But that
> is a separate issue.
> Today Dmitry informs me, his commits disappeared from maint on github.
> On my machine I have now 21 unpushed commits in maint.
> I am clueless, but remember before the last release also one commit
> disappeared.
> Does anybody whant to investigate in the current state or can I push
> them now again?
> Regards
> Frank
> _______________________________________________
> gnucash-devel mailing list
> gnucash-devel at


More information about the gnucash-devel mailing list