Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何对github项目执行多个pull请求_Git_Github - Fatal编程技术网

如何对github项目执行多个pull请求

如何对github项目执行多个pull请求,git,github,Git,Github,我一直以一种非常简单、有限的方式使用git和opensrc 我在github中完成了这个项目 我把我的叉子克隆到我的电脑上 我在电脑上做了一些改变 我提交更改 我推我的github叉子 我创建了从github fork到原始项目的pull请求 这只适用于一个变化 如果我在我的计算机上做了更多的更改,并在接受拉请求之前提交和推送,那么它们将被添加到相同的拉请求中。我知道这并不理想,所以我尝试等待第一个请求被接受,然后再做进一步的更改,但这并不总是可能的 所以我理解,理想情况下,您应该为每个bu

我一直以一种非常简单、有限的方式使用git和opensrc

  • 我在github中完成了这个项目
  • 我把我的叉子克隆到我的电脑上
  • 我在电脑上做了一些改变
  • 我提交更改
  • 我推我的github叉子
  • 我创建了从github fork到原始项目的pull请求
这只适用于一个变化

如果我在我的计算机上做了更多的更改,并在接受拉请求之前提交和推送,那么它们将被添加到相同的拉请求中。我知道这并不理想,所以我尝试等待第一个请求被接受,然后再做进一步的更改,但这并不总是可能的

所以我理解,理想情况下,您应该为每个bug修复创建单独的分支。因此,我创建了一个新分支,进行了更改,提交了更改并将其推回到github但我在github上看不到这个新分支,我不确定下一步该做什么?

当我在这个新分支上运行git push时,我得到

ubuntu@ip-172-31-39-147:~/code/discogs-xml2db/speedup$ git push
warning: push.default is unset; its implicit value is changing in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the current behavior after the default changes, use:

  git config --global push.default matching

To squelch this message and adopt the new behavior now, use:

  git config --global push.default simple

When push.default is set to 'matching', git will push local branches
to the remote branches that already exist with the same name.

In Git 2.0, Git will default to the more conservative 'simple'
behavior, which only pushes the current branch to the corresponding
remote branch that 'git pull' uses to update the current branch.

See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)
当我推动另一个分支时,我没有得到这个,这是否意味着推动实际上没有发生

更新 所以我尝试了Schwerns的建议,命令原样并没有很好地工作,但是添加了安装上游源代码确实起了作用。更改被推送到github,现在我在github上看到了这个新分支

ubuntu@ip-172-31-39-147:~/code/discogs-xml2db/speedup$ git config --global push.default simple
ubuntu@ip-172-31-39-147:~/code/discogs-xml2db/speedup$ git push
fatal: The current branch releasestatus has no upstream branch.
To push the current branch and set the remote as upstream, use

    git push --set-upstream origin releasestatus

ubuntu@ip-172-31-39-147:~/code/discogs-xml2db/speedup$ ^C
ubuntu@ip-172-31-39-147:~/code/discogs-xml2db/speedup$  git push --set-upstream origin releasestatus
Username for 'https://github.com': ijabz
Password for 'https://ijabz@github.com':
Counting objects: 17, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (6/6), done.
Writing objects: 100% (6/6), 600 bytes | 0 bytes/s, done.
Total 6 (delta 5), reused 0 (delta 0)
remote: Resolving deltas: 100% (5/5), completed with 5 local objects.
remote:
remote: Create a pull request for 'releasestatus' on GitHub by visiting:
remote:      https://github.com/ijabz/discogs-xml2db/pull/new/releasestatus
remote:
To https://github.com/ijabz/discogs-xml2db.git
 * [new branch]      releasestatus -> releasestatus
Branch releasestatus set up to track remote branch releasestatus from origin.

我认为你从未将更改推送到Github。Git告诉您它没有完全配置,您需要修复它

gitpush
实际上还有两个部分:推到哪里(“远程”),以及推到哪个分支。当您在主分支上时,
git-push
实际上是
git-push-origin-master
。您从中克隆的远程存储库称为“origin”,Git知道您的主分支来自它的主分支

当你创建一个新分支时,Git不知道你想把它推到哪里。如果在新分支上运行
gitpush
,它将不得不猜测<代码>推送。默认值告诉Git如何猜测,但没有设置

您可以阅读以了解有关选项的更多信息,但我建议将其设置为
simple
。它会猜测您想要将其推送到与您自己的分支同名的分支

git config --global push.default simple
现在您应该能够
git推送
到Github


您还可以为Git拼写:
Git push origin

您确定要将分支推送到GitHub吗?我无法想象,如果推送分支,它不会出现。你能分享你使用的命令吗?@FelixKling可能没有,文件已经提交,但我只是在运行git push时发布了我的内容,我认为这只是一个警告,但可能不是。嗯,好吧,但我只在我的计算机上创建了分支,这是否意味着github中没有同名的远程分支,我如何在github上创建同名分支,或者我应该先在github上创建此分支?@PaulTaylor Git中的所有内容都是本地的,只有少数命令除外。如果您按照上面的说明操作,您应该能够将您的分支推送到GitHub,这将在GitHub上创建一个同名的分支(Git可能会给您进一步的说明)。。更多信息,请阅读此。好的,我试过了,如果我添加了-setup-stream,它就起作用了,但是当我尝试创建一个拉取请求时,它是不正确的。啊,我的错误,我忘记了我需要创建一个针对加速的拉取请求(不是master),在这种情况下,它似乎起作用了。