我想添加一个Git,以便原作者可以提取更改。通常我会在GitHub这样的东西上分叉,工作流程很简单。但是对于外部回购,我确实找到了nothing in the documentation。
有人知道这对外部存储库有何用处?这是我试过的:
% 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 = git@github.com:wishi/gr_802.15.4.git
fetch = +refs/heads/*:refs/remotes/origin/*
上游应该是远程仓库,掌握GitHub thingy。所以经过一个微不足道的第一次改变:
% git commit -a -m "check"
[master 796f97a] check
1 files changed, 1 insertions(+), 1 deletions(-)
% git push origin master
To git@github.com:wishi/gr_802.15.4.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'git@github.com: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.
这样才有意义:合并两个分支:
% git merge upstream/master
fatal: 'upstream/master' does not point to a commit
我在这里......
答案 0 :(得分:8)
我认为这不复杂。
git clone git://wiesel.ece.utah.edu/gr-ieee802-15-4.git
gr-ieee802-15-4
下的wishi
表示。)git remote add github git@github.com:wishi/gr-ieee802-15-4.git
。git push github master
假设您的ssh密钥和内容设置正确,这应该可以正常工作。
原作者可以为您的github存储库添加一个只读URL作为其本地克隆中的遥控器,更新该URL并引入您所做的任何更改。 “拉动请求”必须通过。电子邮件或外部问题跟踪器。