从网站更新github fork(换句话说,没有GIT!) [英] update github fork from web only (in other words WITHOUT GIT!)

查看:150
本文介绍了从网站更新github fork(换句话说,没有GIT!)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何和/或是否可以更新( pull / rebase / reset --hard branchname )github上的项目分支在网站上 没有GIT

以下是具体的问题。我只是通过一个非常慢的互联网连接(400meg的变化)将上游的变化拉到我的本地机器。花了很长时间。我想现在开始在本地进行更改,然后将我的更改上传到github上的fork。问题是,当我推送到github时,git会将这些400mb的更改上传到我的fork中。如果我可以去github.com并告诉叉子从它分叉的地方更新,那么这些400meg将被转移到github上,当我最终推进我的本地更改时,上传只会有几分之差。

一张图。这是做这件事的正常方法

  github:upstream github:origin 
\↗
\\ \\ /
\ / $ b $b↘/
(git pull 400meg slow)(git push 400meg + 1k slow)
\↗
\ /
\ / $ b $b↘/
本地

这就是我想要的

  github:upstream ----> (拉快) - > github:原产地
\↗
\ /
\ / $ b $b↘/
(git pull 400meg slow)(git push 1k fast)
\↗
\ /
\ /
\ / $ b $b↘/
本地

解决方案

这些步骤似乎有效(请检查最后一步)。


  1. 在github上点击您的分支,然后点击右键请求


  2. 点击新建请求
  3. 您应该看到一条消息没有任何东西需要比较。点击尝试切换基地进行比较。



    这将从 forkedrepo:master切换拉。 。fork:master fork:master ... forked:master


  4. 输入一个描述,例如合并,然后点击发送合并请求

  5. 您现在会看到一个拉取请求从分叉回购到你的分叉。滚动到底部。你应该看到这个拉取请求可以自动合并。点击合并拉取请求

    点击确认合并

    >

此时,您应该在您的github仓库中进行所有新更改。为了摆脱多余的合并提交这些步骤似乎工作(或者我失去了一些东西?)



在本地,

  $ git pull origin master 
$ git reset --hard HEAD〜1
$ git push origin master -f

注意:我在这里找到了这个技巧


How do I and/or is it possible to update (pull/rebase/reset --hard branchname) a fork of a project on github ON THE WEBSITE .. WITHOUT GIT

Here's the specific problem. I just pulled the upstream changes to my local machine over a very slow internet connection (400meg of changes). It took a long time. I'd like to now start making changes locally and then upload my changes to my fork on github. The problem is, when I go to push to github git is going to upload those 400mb of changes to my fork. If I could go to github.com and tell the fork there to update from the place it forked then those 400meg would get transferred on github and when I finally went to push my local changes there'd only be a few k difference to upload.

A diagram. This is the normal way to do this

github:upstream               github:origin
        \                          ↗
         \                        /
          \                      /
           ↘                    /
  (git pull 400meg slow)     (git push 400meg+1k slow)
                 \            ↗
                  \          /
                   \        /
                    ↘      /
                      local

This is what I want

github:upstream ----> (pull fast) ->  github:origin
        \                               ↗
         \                             /
          \                           /
           ↘                         /
  (git pull 400meg slow)       (git push 1k fast)
                 \               ↗
                  \             /
                   \           /
                    \         /
                     ↘       /
                       local

解决方案

These steps seem to work (please check the last step).

  1. Go to your fork on github and on the right click "Pull Request"

  2. Click "New Pull Request"

  3. You should see a message "There isn't anything to compare". Click "try switching the base for your comparison".

    This will switch the pull from forkedrepo:master ... fork:master to fork:master ... forked:master.

  4. Type a description like "Merge" and click "Send Pull Request"

  5. You'll now see a pull request going from the forked repo into your fork. Scroll to the bottom. You should see "This pull request can be automatically merged". Click "Merge Pull Request"

  6. Click "Confirm Merge"

At this point you should have all the new changes in your github repo. In order to get rid of the superfluous merge commit these steps seem to work (or maybe I'm missing something?)

Locally,

$ git pull origin master
$ git reset --hard HEAD~1 
$ git push origin master -f

note: I found this technique here.

这篇关于从网站更新github fork(换句话说,没有GIT!)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆