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.

9
  • 1
    But there is no initial add/commit so that initial git push is not going to work. Is that necessary? Commented May 20, 2016 at 20:46
  • Note that git push --set-upstream origin master does not push anything to the remote repository. It only changes the local configuration by "glueing together" your local branch "master" with the remote tracking branch "origin/master". If you are sure that you never will push anything from this repo, or that you have set "push.default" to "simple", you may also omit that statement. Commented May 20, 2016 at 20:51
  • I will definitely never push anything, only pull, so I will omit the statement. But I still need to do an initial add/commit for the git branch -f command to work, right? Commented May 20, 2016 at 20:59
  • If at all, only add your stuff, don't commit! (this would change the local branch and you would get out of sync with the remote repo again). Commented May 20, 2016 at 21:02
  • 1
    ok, and what went wrong for you? Perhaps we all could learn something from that failure? Commented May 22, 2016 at 8:15