On Tue, Apr 02, 2013 at 10:30:35AM -0700, Garrett Cooper wrote:

> I push the branch to origin/ and then things tend to work, but since I
> obviously had been doing things wrong what's the correct order of
> operations for creating a branch and setting the upstream
> appropriately?

Once you have pushed it, the push creates the refs/remotes/origin/foo
tracking branch automatically. You are then free to reference it
wherever you like, including in set-upstream-to. However, you can also
just ask push to do it for you with "--set-upstream" or "-u". So the
workflow is something like:

  $ git checkout -b my-topic
  $ hack hack hack
  $ git commit -m "looking good, time to publish"
  $ git push -u origin HEAD

> PS I love git as a tool, but I really wish the workflows were simpler
> or more straightforward, and error messages were clearer. It seems
> like this would help prevent usage errors like this..

Things slowly improve as people make suggestions. I think the thing that
might have helped here is better advice when "set-upstream-to" is
pointed to a ref that does not exist.

Patches coming in a minute.

To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to