Bruno Bronosky
Bruno Bronosky

Reputation: 70319

Commit from a github issue

I have a very strong understanding of git. I just can't find out how to make a patch, get the object from a SHA, or find a way to credit this user for the commit shown here: https://github.com/sparkfun/DeadOn_RTC/commit/c39db0e3e531938815ec6113d6a0f4283dbe55c0

I've even tried using https://github.com/defunkt/hub

DeadOn_RTC$ hub cherry-pick https://github.com/sparkfun/DeadOn_RTC/commit/c39db0e3e531938815ec6113d6a0f4283dbe55c0
fatal: bad object c39db0e3e531938815ec6113d6a0f4283dbe55c0

DeadOn_RTC$ hub merge https://github.com/sparkfun/DeadOn_RTC/pull/1
Error: awickert's fork is not available anymore

Upvotes: 1

Views: 163

Answers (1)

Charlie
Charlie

Reputation: 7349

There are many ways I can think of to credit the user:

1) Take the actual commit, make a pull request from the issue using a tool like hub? https://stackoverflow.com/a/7841960/504685 ?

2) Create a merge commit of the other user's commit referencing the issue https://help.github.com/articles/closing-issues-via-commit-messages

3) Make a new commit (possibly via git cherry-pick or options on git commit) ensuring you set/keep the other user's details as the author


edit

Being on a laptop with a full git client and sourcetree now, I think I understand more. You are having trouble getting that commit since it's on an inactive pull request. These instructions should help: https://help.github.com/articles/checking-out-pull-requests-locally#modifying-an-inactive-pull-request-locally

Assuming that you have your repo as "origin" and the sparkfun repo as "sparkfun":

git fetch sparkfun pull/1/head:newbranch
git push -f origin newbranch:master

(This will get that commit into the master branch, and throw away your attempt at #1)

Upvotes: 1

Related Questions