Giter Club home page Giter Club logo

Comments (2)

ianfoo avatar ianfoo commented on May 19, 2024

Can you clarify this issue a bit? It is written from the context of someone familiar with the project and this problem. What does "where origin is the fork" mean, exactly? What is the meaning of "upstream" here? I can tell why the remotes under actual seem wrong, since it's the same remote with two names, but I cannot tell why the remotes under expected are right. Who is the user you've run the fork command as--zaquestion? And if so why would you expect the remote to be called upstream instead of zaquestion?

For background, when using hub, I have typically cloned the origin of a project, and when I do a git fork, I expect my user to be the name of the new remote, as shown here:

➜  github.com git clone zaquestion/lab zaquestion/lab
Cloning into 'zaquestion/lab'...
remote: Counting objects: 3323, done.
remote: Compressing objects: 100% (31/31), done.
remote: Total 3323 (delta 8), reused 4 (delta 1), pack-reused 3291
Receiving objects: 100% (3323/3323), 8.69 MiB | 6.13 MiB/s, done.
Resolving deltas: 100% (1066/1066), done.
➜  github.com cd zaquestion/lab
➜  lab git:(master) git fork
Updating ianfoo
From git://github.com/zaquestion/lab
 * [new branch]      ci         -> ianfoo/ci
 * [new branch]      issue40    -> ianfoo/issue40
 * [new branch]      master     -> ianfoo/master
 * [new branch]      mrEdit     -> ianfoo/mrEdit
new remote: ianfoo
➜  lab git:(master) gr -v
ianfoo	[email protected]:ianfoo/lab.git (fetch)
ianfoo	[email protected]:ianfoo/lab.git (push)
origin	git://github.com/zaquestion/lab.git (fetch)
origin	git://github.com/zaquestion/lab.git (push)

from lab.

zaquestion avatar zaquestion commented on May 19, 2024

@ianfoo The confusion here is likely the expectation that origin always refers to the forked from project and never the user fork. This is the way hub operates. In fact, lab supports both paradigms.
Both of these are valid.
"upstream as remote"

origin [email protected]:lab-testing/test
upstream [email protected]:zaquestion/test

"user as remote"

origin [email protected]:zaquestion/test
lab-testing [email protected]:lab-testing/test

Essentially "user as remote" behaves the same as lab, exactly as your example above.

Users wishing to use the upstream mode have 2 options.
clone a fork

lab clone lab-testing/test # fork of zaquestion/test
# yields these remotes
origin [email protected]:lab-testing/test
upstream [email protected]:zaquestion/test

fork with an argument

lab fork zaquestion/test
# yields these remotes, but creates the fork
origin [email protected]:lab-testing/test
upstream [email protected]:zaquestion/test

The above method has a similar issue (#79) to this one

In this ticket lab fork should identify that the users "origin" points to a fork and add a new remote named "upstream" with the forked from repo. Hope that helps!

from lab.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.