On Thu, Dec 22, 2011 at 2:04 PM,  <[email protected]> wrote:
> Hi,
>
> I've been using Magit for some time now. Thanks for this awesome piece of
> software.
>
> I am always confused about where to push to - so I've setup my remote repo.
> Now when I type P and select Push, it prompts for where to push to (even
> though the remote is set up. git remote gives me bitbucket

Hi,

it's not enough to have the remote being registered (which you have
here), you also need it to be "attached" to the branch you want to
push.

In your case you should do something like
$ git config branch.develop.remote bitbucket

When that's ok, you should not be prompted anymore.

In the current master of magit, there's now new options for using
--set-upstream when pushing. That would also do it.

> So when it prompts me, am I supposed to type the name of the remote repo (in
> my case, bitbucket) or the remote branch (e.g. develop)?
>
> This time I typed bitbucket/develop and it gives me some error - and now
> shows some unpulled commits and unpushed commits.

You should enter only the remote name.
Now we should probably safeguard this, and not configuring
branch.<branch>.remote when the value is invalid.
Since we don't, you observe the error messages you sent
('HEAD..bitbucket/develop/develop' instead of
'HEAD..bitbucket/develop' for ranges).

You can fix it by hand in git config, by running the correct command:
$ git config branch.develop.remote bitbucket

Hope this helps,

Yann.

Reply via email to