I want to make additions to a Git, so that the original author is able to pull the changes. Normally I'd fork that on something like GitHub and the workflow is simple. However for external repos I did find nothing in the documentation.
Does anybody know how this would work for an external repository? Here's what I tried:
% more .git/config
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "upstream"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = git://wiesel.ece.utah.edu/gr-ieee802-15-4.git
[branch "master"]
remote = origin
merge = refs/heads/master
[remote "origin"]
url = [email protected]:wishi/gr_802.15.4.git
fetch = +refs/heads/*:refs/remotes/origin/*
upstream is supposed to be the remote repo, and master the GitHub thingy. So after a trivial first change:
% git commit -a -m "check"
[master 796f97a] check
1 files changed, 1 insertions(+), 1 deletions(-)
% git push origin master
To [email protected]:wishi/gr_802.15.4.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to '[email protected]:wishi/gr_802.15.4.git'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes before pushing again. See the 'Note about
fast-forwards' section of 'git push --help' for details.
So that makes sense: merge the two branches:
% git merge upstream/master
fatal: 'upstream/master' does not point to a commit
And here I am...
I don't think it's this complicated.
git clone git://wiesel.ece.utah.edu/gr-ieee802-15-4.gitgr-ieee802-15-4 under the username wishi).git remote add github [email protected]:wishi/gr-ieee802-15-4.git.git push github masterAssuming that your ssh keys and stuff are set up correctly, this should work fine.
The original author can add a read only URL for your github repository as a remote in his local clone, update that and pull in any changes which you've made. The "pull request" will have to be done via. email or an external issue tracker.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With