Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git fork [repo] should add upstream if it doesn't already exist. #79

Closed
zaquestion opened this issue Dec 19, 2017 · 5 comments
Closed

Comments

@zaquestion
Copy link
Owner

Similar to: #78 expected outcome is the same

@zaquestion zaquestion added the bug label Dec 19, 2017
@zaquestion zaquestion added this to To Do in Bugs via automation Dec 19, 2017
@zaquestion zaquestion moved this from To Do to In Progress in Bugs Feb 18, 2018
@zaquestion zaquestion moved this from In Progress to To Do in Bugs Feb 18, 2018
@tydavis
Copy link
Contributor

tydavis commented Jun 7, 2018

@bmeneg
Copy link
Collaborator

bmeneg commented Jun 15, 2021

I'm not sure if I understand the expectation here: today, when a lab fork [repo] is performed, both origin and upstream is added, the first is added by the git clone command itself and the later is added by lab. This is the default behavior for when forking a project from outside a git repo. When forking from origin it doesn't really makes sense to add upstream if origin is the actual upstream project in gitlab, does it?

@tydavis
Copy link
Contributor

tydavis commented Jun 15, 2021

This is to work with/around the issues which copy-paste commands have wrought. Nearly all documented / blogged-about / etc operations are set to run on origin. By making sure that origin is the personal fork of the repo, there's less of a chance that an accidental merge will be made against upstream's representation.

Though, this also goes against most other tools' methods (like hub) where a forked repo uses the username in order to represent the local fork (e.g. tydavis instead of origin)

@bmeneg
Copy link
Collaborator

bmeneg commented Jun 16, 2021

Ahh I see! So the idea was to rename origin to upstream when the user forks the project pointed by origin.
Thanks for the clarification 👍

The issue I see with this approach is: users getting pretty confused wondering "what happened" to their remotes "out of sudden".
It would be necessary to also update all the branches tracking origin remote branches to then track upstream instead.

IMHO I don't think that lab should try to be "too smart" about such things, users should keep track of their own remote names and change as they please. I would vote for not implementing it and let things as they are.

@bmeneg
Copy link
Collaborator

bmeneg commented Jun 17, 2021

Considering this issue is from 2017, the behavior didn't change and that in general it doesn't really look like a good approach, I'm going to close the issue. But please, feel free to re-open it.

@bmeneg bmeneg closed this as completed Jun 17, 2021
Bugs automation moved this from To Do to Done Jun 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Bugs
  
Done
Development

No branches or pull requests

3 participants