wis*_*shi 3 git version-control merge git-branch
我想添加一个Git,以便原作者能够提取更改.通常我会在GitHub这样的东西上分叉,工作流程很简单.但是对于外部回购,我没有在文档中找到任何内容.
有谁知道这对外部存储库有用吗?这是我试过的:
% 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/*
Run Code Online (Sandbox Code Playgroud)
上游应该是远程回购,并掌握GitHub的东西.经过一个微不足道的第一次改变后:
% 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.
Run Code Online (Sandbox Code Playgroud)
这是有道理的:合并两个分支:
% git merge upstream/master
fatal: 'upstream/master' does not point to a commit
Run Code Online (Sandbox Code Playgroud)
我在这里......
我不认为这很复杂.
git clone git://wiesel.ece.utah.edu/gr-ieee802-15-4.gitgr-ieee802-15-4在用户名下wishi).git remote add github git@github.com:wishi/gr-ieee802-15-4.git.git push github master假设您的ssh密钥和内容设置正确,这应该可以正常工作.
原作者可以为您的github存储库添加一个只读URL作为其本地克隆中的远程,更新并引入您所做的任何更改."拉动请求"必须通过.电子邮件或外部问题跟踪器.
| 归档时间: |
|
| 查看次数: |
2203 次 |
| 最近记录: |