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

Remote url when checking out branch #576

Closed
rejeep opened this issue Mar 1, 2013 · 7 comments
Closed

Remote url when checking out branch #576

rejeep opened this issue Mar 1, 2013 · 7 comments

Comments

@rejeep
Copy link

rejeep commented Mar 1, 2013

Hi,

In a recent update of Magit, the remote user changed when checking out a new remote branch, so:

  • I got a pull request
  • I did f a (since that user repo was already added)
  • I did b b to check out that branch locally

This is the output:

$ git --no-pager checkout -b hide-steps-for-successful-scenarios refs/remotes/magnars/hide-steps-for-successful-scenarios
Switched to a new branch 'hide-steps-for-successful-scenarios'
Branch hide-steps-for-successful-scenarios set up to track remote branch hide-steps-for-successful-scenarios from magnars.

In magit it looks like this:

Remote:   hide-steps-for-successful-scenarios @ magnars (https://github.com/magnars/ecukes.git)
Local:    hide-steps-for-successful-scenarios ~/Code/ecukes/
Head:     8f7f565 Hide steps for successful scenarios

As you can see, the remote url is https://github.com/magnars/ecukes.git. It has always before been https://github.com/rejeep/ecukes.git (magnars => rejeep).

Why is this?

@dudebout
Copy link
Member

dudebout commented Mar 1, 2013

I do not know how pull requests appear but I do not see any inconsistency in what you have pasted.

You checked out a branch in refs/remotes/magnars and it is therefore tracking magnars. Why is that unexpected?

@rejeep
Copy link
Author

rejeep commented Mar 1, 2013

This is how I noticed it. I wanted to check out a remote pull request branch, make a change and push it to my origin repo.

  • Add remote host
  • Fetch f a
  • Checkout b b
  • Make change
  • Push P P

But now when I push, it will be the remote repo, not my origin. Has this been changed or am I drunk?

@dudebout
Copy link
Member

dudebout commented Mar 1, 2013

Where do pull requests appear? If they appear in your repo what you say should work. You pull from your repo so the upstream is your repo.

However, from the "trace" you gave it seems that you grabbed the pull request directly from magnars remote instead of taking it from the pull request in your own repo. In which case the branch's upstream is magnars.

@dudebout
Copy link
Member

dudebout commented Mar 1, 2013

If my last comment does not answer your question please do a quick pull request to http://github.com/dudebout/foo so that I can see what they look like from the other side ;-)

@rejeep
Copy link
Author

rejeep commented Mar 1, 2013

Where do pull requests appear? If they appear in your repo what you say should work. You pull from your repo so the upstream is your repo.

Since I have to add the remote repo, I would say they do not live in my repo.

(I made a PR to foo)

@dudebout
Copy link
Member

dudebout commented Mar 1, 2013

Thanks for the PR. From the email I received

You can merge this Pull Request by running

  git pull https://github.com/rejeep/foo master

it is clear that the pull request (in your case) lives in magnars.

From that point you have two ways of testing the PR:

  • create a new branch, in which case it will be following magnars
  • merge it in a branch you already have that is following rejeep

Are you sure you did not use the other method in the past? If not, I cannot explain the change in behavior.

@rejeep
Copy link
Author

rejeep commented Mar 1, 2013

Sound reasonable. Since I cant say exactly what changed, I'm closing this and reopen if I have a more detailed problem description.

Thanks for the help!

@rejeep rejeep closed this as completed Mar 1, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants