Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • 6
    This helped in my case: git push -u origin HEAD. I think it's the most clear way. Commented Mar 7, 2014 at 12:12
  • 2
    Yeah, you never remember what you last typed as a branch, exactly, so this is the way to go. Commented Feb 23, 2016 at 11:34
  • 5
    @marksyzm If you can't remember what branch you're on or what you named it, you probably shouldn't be pushing at all! At least, not without running git status first. Commented Mar 9, 2016 at 5:40
  • 2
    Yeah, gotta make sure the world doesn't explode on that push; I agree. Commented Mar 9, 2016 at 11:24
  • 2
    This is the most efficient way to create a tracking branch as well as a remote branch at the same time. I'd also like to add git remote show origin as a third step just to visualize the new tracking/tracked relationship. Commented Sep 12, 2016 at 14:39