Skip to content

Conversation

@jakehschwartz
Copy link

  • Default remote is 'origin'

@jroper
Copy link
Member

jroper commented Mar 7, 2017

I'm not sure about this - remote tracking branches are the git way of specifying what the default should be, so that you don't need to hard code conventions like origin into tools. Setting the remote tracking branch only needs to be done once, and it's often done automatically when you checkout a branch. I don't think we should be undermining gits inbuilt mechanism for specifying defaults - I think failing when there's no default configured is the right behaviour, this gets people to do the right, git way of doing things, rather than inventing our own default mechanism.

@jakehschwartz
Copy link
Author

Thanks for the feedback. Do you mind explaining (or linking to something that explains) how I should be using Git in order to make the plugin work? Just using git checkout -b new-branch does not set up a a remote or a merge entry in my .git/config, which is what the code uses to determine what it calls trackingRemote and trackingBranch. Thanks again.

@jroper
Copy link
Member

jroper commented Mar 8, 2017

If it is a new branch that you've created, then when you push it, run:

git push -u <remote> [<branch>]

to set the tracking branch. If the remote branch already exists, and you don't want to push, you can do:

git branch -u <remote>/<branch>

@jakehschwartz
Copy link
Author

So it's a bit of a chicken and a egg problem. In my other PR, I've added the ability to checkout new branches, but pushing to them doesn't work because the remote is not set. But to set up the tracking as you described, you have to know the remote you want to use.

@jakehschwartz
Copy link
Author

I am going to try to merge some of this functionality with my other PR #191

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants