search

Home  >  Q&A  >  body text

github - git push 如何提交到 upstream ? 让 fork 知道有 commit

Administrator@USER-20140 /D/website/flxx2/basic/vendor/g9901/yii2-gftp (master)
$ git remote -v
origin  git@github.com:G9901/yii2-gftp.git (fetch)
origin  git@github.com:G9901/yii2-gftp.git (push)
upstream        https://github.com/hguenot/yii2-gftp.git (fetch)
upstream        https://github.com/hguenot/yii2-gftp.git (push)

G9901/yii2-gftp 是我 fork 来自 hguenot/yii2-gftp,我现在在本地修改了,然后git push,可 hguenot/yii2-gftp 并没有收到提交。而我发现在 hguenot/yii2-gftp 是可以直接在网页上进行 pull request 然后commit,为什么不能客户端提交?

Administrator@USER- /D/website/flxx2/basic/vendor/g9901/yii2-gftp (master)
$ git push upstream
Username for 'https://github.com': G9901
Password for 'https://G9901@github.com':
remote: Permission to hguenot/yii2-gftp.git denied to G9901.
fatal: unable to access 'https://github.com/hguenot/yii2-gftp.git/': The request
ed URL returned error: 403

无法提交到 upstream ,那么原作者就无法知道有修改,无法操作合并,可问题是我在github.com的网页里面却可以提交 commit,如何才可以在我客户端提交过去。

稀里糊涂的

现在在 github.com 网页上提交了,又变成这样了: https://github.com/hguenot/yii2-gftp/pull/5

G9901 wants to merge 4 commits into hguenot:master from G9901:master

PHPzPHPz2774 days ago902

reply all(2)I'll reply

  • 習慣沉默

    習慣沉默2017-05-02 09:23:35

    Using git push will push to the remote warehouse corresponding to origin by default, so upstream cannot obtain commit. If you want to push to upstream, there are two requirements. The first is that you have write permission to hguenot/yii2-gftp.git. That means you join this project. The second is to push git push upstream explicitly. The prompt indicates that you do not have permission to write to hguenot/yii2-gftp.git. Pull/Request is a mechanism for a fork project to submit modifications and merge, and is suitable for the fork project to submit modifications that do not have permission to the original project.

    reply
    0
  • 漂亮男人

    漂亮男人2017-05-02 09:23:35

    1. Your fork and upstream are different repos, so pushing to fork cannot let upstream know; this is a premise and one of the basic concepts of git, obviously you are very vague about this

    2. Let’s not talk about the command line first. You must first know how github handles pull requests (of course, you must first know what a pull request is. For this information, you can go to github help)

    3. Then take a look at the documentation on the request-pull subcommand in the git documentation. At this time you begin to establish the theoretical basis for push to fork then let upstream know

    4. Unfortunately, just relying on git request-pull 还不能直接完成 github 的 pull request(不是不能,而是有点复杂);幸运的是:如果你用 GUI,那么 github 有 app 可以帮你做这件事;如果你用 CLI,那么 1)mac 下 可以 brew install hub then hub/git pull-request,2)linux 下可以用 sudo apt-get install github-cli, 3) windows? Not sure, maybe you can ask for help scoop

    For ordinary users, it is enough to learn to operate github on the web and app. Playing with cli requires certain skills and exploration capabilities.

    reply
    0
  • Cancelreply